In css, you can use the linear-gradient() or radial-gradient() gradient function together with rgba() to set the opacity gradient. linear-gradient() and radial-gradient() can set gradients, and rgba() can control opacity.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
In css, you can use the linear-gradient() or radial-gradient() gradient function with rgba() to set the opacity gradient.
The linear-gradient() and radial-gradient() functions can set the gradient effect:
linear-gradient(): Create a linear gradient
radial-gradient(): Create a radial gradient
rgba() function uses red (R), green (G), blue (B) , transparency (A) overlay to generate a variety of colors.
Code example:
图片透明度渐变实例演示 正常图片
设置线性渐变不透明度效果的图片设置径向渐变不透明度效果的图片
Rendering:
##Description:
In order to create a linear gradient, you must define at least two color nodes. The color node is the color you want to show a smooth transition. At the same time, you can also set a starting point and a direction (or an angle). The syntax is as follows:background-image:linear-gradient(direction, color-stop1, color-stop2, ...);
background-image:radial-gradient(shape size at position, start-color, ..., last-color);
css video tutorial)
The above is the detailed content of How to achieve opacity gradient in css. For more information, please follow other related articles on the PHP Chinese website!