Page 55 - CSS
P. 55
explanation and specs, see the MDN Docs
Background Shorthand
The background property can be used to set one or more background related properties:
CSS
Value Description
Ver.
background- Background image to use 1+
image
background- Background color to apply 1+
color
background- Background image's position 1+
position
background-size Background image's size 3+
background- How to repeat background image 1+
repeat
background- How the background is positioned (ignored when background- 3+
origin attachment is fixed)
How the background is painted relative to the content-box, border-
background-clip 3+
box, or the padding-box
background- How the background image behaves, whether it scrolls along with 1+
attachment its containing block or has a fixed position within the viewport
initial Sets the property to value to default 3+
inherit Inherits property value from parent 2+
The order of the values does not matter and every value is optional
Syntax
The syntax of the background shorthand declaration is:
background: [<background-image>] [<background-color>] [<background-position>]/[<background-
size>] [<background-repeat>] [<background-origin>] [<background-clip>] [<background-
attachment>] [<initial|inherit>];
Examples
background: red;
https://riptutorial.com/ 33

