background
Introduction
The background shorthand CSS property sets all background style properties at once, such as background-clip,background-color,background-image,background-origin,background-position,background-repeat,background-size.
Examples

Syntax
The background property is specified as one or more background layers, separated by commas.
The syntax of each layer is as follows:
<bg-image><position><bg-size><repeat-style>- The
<bg-size>value may only be included immediately after<position>, separated with the '/' character, like this:"center/80%". - The
<box>value may be included zero, one, or two times. If included once, it sets bothbackground-originandbackground-clip. If it is included twice, the first occurrence setsbackground-origin, and the second setsbackground-clip.
The
background-colorvalue may only be included in the last layer specified.
Values
<box>
See background-clip and background-origin
<background-color>
See background-color
<bg-image>
See background-image
<position>
<repeat-style>
<bg-size>
See background-size
Note
- The background-color must be written in the last image, otherwise the parser will consider it an invalid background.
For example:
background: red url('./a.png'), url('./b.png);'will be ignored as an error. The correct way to write it should be:background: url('./a.png'),red url('./b.png);
Formal definition
| Initial value | background-image: none background-position: 0% 0% background-size: auto auto background-repeat: repeat background-origin: padding-box background-clip: border-box background-color: transparent |
| Applies to | all elements |
| Inherited | no |
| Animatable | no |
Formal Syntax
Difference between web
<bg-layer>does not support the<attachment><image>only support<url>and<gradient>_These properties are also supported in web such as
<image-set>、<element()>、<paint()>、<cross-fade()>_<gradient>only support<linear-gradient>and<radial-gradient>These properties are also supported in web such as
<repeating-linear-gradient()>,<radial-gradient()>,<repeating-radial-gradient()>,<conic-gradient()>
Compatibility
LCD tables only load in the browser