美文网首页
css字体渐变色

css字体渐变色

作者: 苏本的书柜 | 来源:发表于2019-03-28 20:59 被阅读0次
image.png

css字体渐变色
第一种方式
-webkit-line-clamp: 2;
background-image: -webkit-linear-gradient(bottom, rgba(251,84,62,1),rgba(245,134,89,1));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
常用
第二种方式
background: linear-gradient(to right, red, blue);
-webkit-background-clip: text;
color: transparent;
-webkit-text-fill-color: transparent;
text-fill-color: transparent;
第三种方式
h1{
position: relative;
color: yellow;
}
h1:before{
content: attr(text);
position: absolute;
z-index: 10;
color:pink;
-webkit-mask:linear-gradient(to left, red, transparent );
}
<h1 text="前端简单说">前端简单说</h1>

相关文章

网友评论

      本文标题:css字体渐变色

      本文链接:https://www.haomeiwen.com/subject/yfqhbqtx.html