HTML and CSS Reference
In-Depth Information
/* Chrome 1-3, Safari 4 */
-webkit-background-origin: border-box;
/* Firefox 1-3.6 */
-moz-background-origin: border;
background-origin: border-box;
background
The background property is a shortcut for setting all background properties in a single
declaration.
background : <background-color> + <background-image> +
<background-repeat> + <background-attachment> +
<background-position> + <background-size> +
<background-clip> + <background-origin>
The order of the values is irrelevant because there is no ambiguity between them.
Any one of the values can be left out, but keep in mind that those omitted properties are
reset to their defaults when using this property.
background: url(bg.png) no-repeat fixed right bottom;
In most cases, it is preferable to use shorthand properties such as this one when
setting more than one of the individual properties. It has better performance and is easier
to maintain than using the equivalent longhand properties seen here:
background-image: url(bg.png);
background-repeat: no-repeat;
background-attachment: fixed;
background-position: right bottom;
Multiple backgrounds
More than one background can be applied to the same element by specifying the property
values in a comma-separated list. The first background in the list appears at the top, and
each successive background is visible only through transparent areas of the backgrounds
stacked on top of it.
background-image: url(bg1.png), url(bg2.png);
background-repeat: no-repeat, repeat-y;
background-attachment: fixed, fixed;
background-position: right bottom, top left;
 
Search WWH ::




Custom Search