background

The background property is shorthand for setting background-attachment, background-clip, background-color, background-image, background-position, and background-repeat.

Values

background: value
Value Initial Description
background-attachment scroll Specifies whether the background image is fixed with the viewport, the element's contents, or the element itself
background-clip border-box Specifies the area within which the background is painted
background-color transparent Sets the background color
background-image none Sets the background image
background-position 0% 0% Specifies the initial position of the background image
background-repeat repeat Specifies whether the background image is repeated

DOM

object.style.background = "value";

Example | background-attachment | fixed

Example | background-attachment | local

Example | background-attachment | scroll

Example | background-clip | border-box

Example | background-clip | content-box

Example | background-clip | padding-box

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-clip

Example | DOM | background-color

Example | DOM | background-image

Example | DOM | background-position

Example | DOM | background-repeat

External

W3C Cascading Style Sheets, level 1

W3C Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification

W3C CSS Backgrounds and Borders Module Level 3