Property | Description | Possible Values | Examples |
---|---|---|---|
background-attachment | Declares the attachment of a background image (to scroll with the page content or be in a fixed position). | fixed scroll | div { background-attachment:fixed; } div { background-attachment:scroll; } |
background-color | Declares the background color. | Valid color names, RGB values, hexidecimal notation. | div { background-color:green; } div { color:#00FF00; } |
background-image | Declares the background image of an element. | URL values. | div { background-image:url(images/img.jpg); } body { background-image:url(img.jpg); } |
background-position | Declares the position of a background image. | Lengths or percentages for the x and y positions, or one of the predefined values: top left | div { background-position:10px 50px; } div { background-position:bottom right; } |
background-repeat | Declares how and/or if a background image repeats. | repeat repeat-x repeat-y no-repeat | div { background-repeat:repeat-x; } div { background-repeat:no-repeat; } |
background | Used as a shorthand property to set all the background properties at once. | Separate values by a space in the following order (those that are not defined will use inherited or default initial values): background-color | div { background:green url(image.jpg) no-repeat fixed center center; } div { background:url(image.jpg) fixed; } |