The background property is a shorthand property to apply several background -related properties in a single property. And it specifies the following properties
Value |
Description |
background-color |
Specifies the background color to be used |
background-position |
Specifies the position of the background images |
background-repeat |
Specifies how to repeat the background images |
background-attachment |
Specifies if background images are fixed or scrolls with web page |
background-image |
Specifies background images to be used |
The font size is required and must be given. The line-height is optional. The font-family must also be given. It is used as
body {
background: #0f0 url(logo.jpg) repeat-x fixed top right;
}
background: #0f0 url(logo.jpg) repeat-x fixed top right;
}
In the example the background shorthand property combines the five separate background properties which are the background-color , background-image , background-repeat , background-attachment and background-position into one single background property. Using the background property all five properties or any combination of the other properties, in any order can be done.