Properties
CSS
background
The background property is a shorthand property for setting background-attachment, background-color, background-image, background-position, and background-repeat.
- Syntax
- Example | background-attachment | fixed
- Example | background-attachment | scroll
- Example | background-color | color
- Example | background-color | transparent
- Example | background-image | none
- Example | background-image | uri
- Example | background-position | bottom
- Example | background-position | center
- Example | background-position | left
- Example | background-position | length
- Example | background-position | percentage
- Example | background-position | right
- Example | background-position | top
- Example | background-repeat | no-repeat
- Example | background-repeat | repeat
- Example | background-repeat | repeat-x
- Example | background-repeat | repeat-y
- Example | DOM | background-attachment
- Example | DOM | background-color
- Example | DOM | background-image
- Example | DOM | background-position
- Example | DOM | background-repeat
- References
Syntax
CSS
background: [<'background-color'> || <'background-image'> || <'background-repeat'> || <'background-attachment'> || <'background-position'>] | inherit
DOM
[window.]document.getElementById("element-id").style.background = "background-attachment background-color background-image background-position background-repeat";
| Initial: | transparent none repeat scroll 0% 0% |
| Applies To: | all elements |
| Inherited: | no |
| Percentages: | allowed on background-position |
| Media: | visual |
