CSS Tutorial
Menu
CSS Advanced
Menu
CSS Responsive
Menu
CSS Grid
Menu
Background Shorthands
To reduce the code, it is possible to define all the background properties in one single property, which is known as a shorthand property.
HTML
The background Property
The background property is a shorthand property for specifying all the background properties in one declaration.
Here, the background image is only shown once, and it is also positioned in the top-right corner.
We have also added a right margin, so that the text will not write over the background image.
CSS
background: #ffffff url("img_tree.png") no-repeat right top;
margin-right: 200px;
Output

While setting the shorthand property the order of the property values is:
- background-color.
- background-image.
- background-repeat.
- background-attachment.
- background-position.