From W3C Wiki
< CSS‎ | Properties
Revision as of 17:31, 10 June 2011 by Hiroki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


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.


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.


See individual properties.


Example A


 body {
   background: url("bg.png") right bottom no-repeat fixed;


    <p>This is a paragraph</p>

Csslist2 background-position.png

CSS Reference

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