CSS: background (shorthand)
background (shorthand)
the property background is a shorthand for the following
- background-color
- background-image
- background-position / background-size
- background-repeat
- background-origin and background-clip
- 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.
- one value → for both.
- two values → for origin and clip.
- zero value →
background-origindefaults topadding-boxandbackground-clipdefaults toborder-box.