text-fill-color
和background-clip
属性来实现。
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>
注意:请访问此链接获取更多信息。