The gradient attributes in css3 include linear-gradient, radial-gradient, conic-gradient, repeating-linear-gradient, repeating-radial-gradient, etc. Detailed introduction: 1. Linear-gradient, linear gradient, can gradient along a straight line. You can specify the starting point and end point of the gradient, as well as the position and color of each color stop point, etc.
The gradient property in CSS3 can create a smooth color transition effect by specifying the transition between the starting color and the ending color. The following are the commonly used gradient attributes in CSS3:
1. linear-gradient: linear gradient, which can gradient along a straight line. You can specify the starting and ending points of the gradient, as well as the position and color value of each color stop.
For example, to create a linear gradient from red to blue you can use the following code:
background: linear-gradient(red, blue);
2. radial-gradient: radial gradient, which can radiate outward from a center point. . You can specify the starting and ending center points of the gradient, as well as the position and color value of each color stop.
For example, to create a radial gradient that radiates outward from the center, you can use the following code:
background: radial-gradient(circle, red, blue);
3. conic-gradient: Conic gradient, you can gradient along a cone. You can specify the starting and ending angles of the gradient, as well as the position and color value of each color stop.
For example, to create a cone gradient from red to blue you can use the following code:
background: conic-gradient(red, blue);
4. repeating-linear-gradient: Repeating linear gradient can be applied repeatedly within a specified area Linear gradient. You can specify the starting and ending points of the gradient, as well as the position and color value of each color stop.
For example, to create a repeating linear gradient from red to blue you can use the following code:
background: repeating-linear-gradient(red, blue);
5. repeating-radial-gradient: repeating radial gradient, can be within a specified area Apply the radial gradient repeatedly. You can specify the starting and ending center points of the gradient, as well as the position and color value of each color stop.
For example, to create a repeating radial gradient that radiates outward from the center, you can use the following code:
background: repeating-radial-gradient(circle, red, blue);
In addition to the above several commonly used gradient properties, CSS3 also provides some other gradients Properties, such as gradient angle, gradient shape, etc. You can choose appropriate gradient attributes according to specific needs to achieve the desired effect.
The above is the detailed content of What are the css3 gradient properties?. For more information, please follow other related articles on the PHP Chinese website!