Home > Common Problem > What are the css3 gradient properties?

What are the css3 gradient properties?

百草
Release: 2023-11-01 09:52:08
Original
1672 people have browsed it

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.

What are the css3 gradient properties?

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);
Copy after login

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);
Copy after login

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);
Copy after login

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);
Copy after login

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);
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template