Specifies or returns up to five separate background properties, in a shorthand form.
With this property, you can set the background color and / or image of any visible HTML element.
Furthermore, you can set how the background image is displayed. You have control over how the background image behaves if the
contents of the element are scrolled (stays in a fixed position, or scrolls with the contents, as it normally does). You can also set
how the image should be repeated (repeats vertically, horizontally, both, or in neither direction).
These features can also be set with five different style properties, listed below.
The use of separate properties is highly recommended for non advanced authors for better controllability.
To set, you can use all six properties.
Specifies or returns how to tile the backgroundImage relative to the upper-left corner of the container object.
Takes the value of this property from the computed style of the parent element.
Default: transparent none repeat scroll 0% 0%.
Example HTML code 1:
This example illustrates the use of the background property:
background: #F9F9F9 url("picture.gif") no-repeat center bottom;
background-position: center bottom;
</style></head><body><divclass="example1">The background image is at the center bottom of this division.</div><divclass="example2">This is the same, but without shorthand background property.</div></body>