From W3C Wiki
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.