有没有办法用不同的颜色部分填充文本?
这个问题在这里已经有了答案:
是的,你可以使用text-fill-color
和background-clip
检查这个更多的细节和例子:https://css-tricks.com/how-to-do-knockout-text/
html, body{ background: #000; }
p{ margin: 0px; }
#clip{
background: linear-gradient(to right, rgba(127,127,127,1) 23%,rgba(234,85,7,1) 20%,rgba(234,85,7,1) 57%,rgba(127,127,127,1) 59%);
background-attachment: fixed;
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
font-size: 8vw;
font-weight: bold;
text-align: center;
}
<p id="clip">Lorem ipsum dolor sit </p>
链接地址: http://www.djcxy.com/p/23785.html
上一篇: Is there a way to partially fill text with different colours?