以下是我想要达到的目标:

有没有办法用W3网络技术,例如SVG,画布?
发布于 2018-04-01 21:05:32
是的,您可以使用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>
注意:访问此链接以获得更多信息。
https://stackoverflow.com/questions/49602408
复制相似问题