The CSS Background Attribute

As is so often the case, CSS background is a shortcut way to assign a number of sub-attributes

The composite background attribute is assigned thus

background:yellow url(imagepath) left top no-repeat;

This is not an inherited property - i.e. in a child element, if not assigned, it takes the default value rather than the corresponding value in its parent container.

Each of these attributes can also be assigned the setting inherit which causes them to pick up their value from their parent element.

Jump To...

Colophon