CSS: background (shorthand)

By Xah Lee. Date: . Last updated: .

background (shorthand)

the property background is a shorthand for the following

  1. background-color
  2. background-image
  3. background-position / background-size
  4. background-repeat
  5. background-origin and background-clip
  6. background-attachment

order

order does not matter except:

background-position / background-size

must be together in this order with slash between them, if background-position is given.

background-origin background-clip

are together, may have one or two or zero values.

CSS. Background