gpt4 book ai didi

css - 有没有办法用不同的颜色部分填充文本?

转载 作者:行者123 更新时间:2023-12-04 15:17:54 26 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





Is it possible to apply CSS to half of a character?

(21 个回答)


3年前关闭。




这是我想要实现的目标:
enter image description here

有没有办法用 W3 网络技术来做到这一点,例如SVG, Canvas ?

最佳答案

是的,您可以使用 text-fill-colorbackground-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>


注意:访问 this link想要查询更多的信息。

关于css - 有没有办法用不同的颜色部分填充文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49602408/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com