The background property in CSS is used to set the background of an element, including color, image, gradient and border. The specific syntax is: background:
| | | ; Multiple values are accepted, and each value corresponds to a different background layer. The background property has other properties such as background-position, background-repeat, background-size, and background-attachment.
Background in CSS
What is background?
The background property is used to set the background of an element, including color, image, gradient and border.
How to use the background attribute?
The general syntax of the background attribute is as follows:
background: | | | ;
background parameter description:
linear-gradient
orradial-gradient
.Compound value of background:
The background property can accept multiple values, each value corresponding to a different background layer. For example:
background: red url("image.png") no-repeat center center;
This will create a background where:
Other properties of background:
In addition to background color, image and border, the background property There are other properties that control the appearance of the background, such as:
background-position
: Specifies the position of the background image or gradientbackground-repeat
: Specify how the background image or gradient is repeatedbackground-size
: Specify the size of the background image or gradientbackground-attachment
: Specify whether the background is fixed or scrollingThe above is the detailed content of What does background mean in css. For more information, please follow other related articles on the PHP Chinese website!