Css/Properties/background

From W3C Wiki

background

The background property is a shorthand property for setting the individual background properties (i.e., 'background-color', 'background-image', 'background-repeat', 'background-attachment' and 'background-position') at the same place in the style sheet.

Description

Values [<'background-color'> || <'background-image'> || <'background-repeat'> || <'background-attachment'> || <'background-position'>] | inherit
Initial value see individual properties
Applies to All elements
Inherited No


Point, Note

  • Given a valid declaration, the 'background' property first sets all the individual background properties to their initial values, then assigns explicit values given in the declaration.


Values

See individual properties.


Example

Example A

[style.css]

 body {
   background: url("chess.png") gray 50% repeat fixed;
 }


CSS Reference

The CSS specification defines the background-attachment property in 14.2.1 Background properties.