CSS Property - Background

Value: <background-color> || <background-image> || <background-repeat> || <background-attachment> || <background-position>
Initial: not defined for shorthand properties
Applies to: all elements
Inherited: no
Percentage values: allowed on <background-position>

The CSS "background" property is a shortend version for setting the individual background properties in one string in a style sheet or as an inline style in a HTML document:

Values that can be used for the "background" property are set and restricted to the values from the individual background properties.

Example:

Single property:
body{
background: white;
}

Multiple Properties:
body{
background: url("image.png") top left repeat fixed #CCCCCC;
}

The "background" property sets all of the individual background properties. In the first example we have only set a value for the "background-color", the other properties are set to their initial value. In the second example all of the "background" properties have been used.

Check Out Our Sponsors
Check Out Our Host

ANHosting

Free CSS.com is proud to be hosted by ANHosting.com. US Based Support starting at only 23 cents a day.
Use the coupon code FREECSS for 3 free months of hosting. Click Here »

Bookmarks
RSS Feed    Search

Support Free CSS.com. Sign up for a FREE account with MailChimp. No Credit Card Necessary!