css 文字渐变

background: linear-gradient(to top, #21edff 0%, #ffc600 40%, #ff72df 100%);
-webkit-background-clip: text;
color: transparent;

使用css3 linear-gradient 线性渐变 to 控制渐变方向,0%渐变位置

background-clip: 指定背景绘制区域

color: transparent; 文字颜色设为透明,要不然会覆盖背景色

猜你喜欢

转载自blog.csdn.net/XueZePeng18729875380/article/details/131184738