因此,我正在尝试使网站中的某些文本与背景颜色相同。我已经考虑过两种方法,一种可能是使用一些JS使文本在该特定位置具有背景色(例如div中的切口),另一种是我不知道该怎么做(并且尚未在网上找到任何东西)。或者,我可以使其渐变并控制渐变的开始位置。
这是我的代码:
.catchphrase {
font-family: Niconne;
font-size: 3.5vw;
font-weight: 400;
background: -webkit-linear-gradient(0deg, #1761A0 74%, #6D37B0 26%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
<div id="catch_div">
<asp:Label ID="Label1" runat="server" Text="Label" CssClass="catchphrase">Feel the rythem</asp:Label>
</div>
这就是它所产生的,当我添加%values时,梯度消失了:
有人有什么主意吗?(如果有一种方法可以使文本与背景颜色相同,我也希望听到)
.catchphrase{
font-family: Niconne;
font-size: 5vw;
font-weight: 400;
background: #75CF55;
background: -webkit-linear-gradient(to right, #75CF55 0%, #CF1BC9 41%);
background: -moz-linear-gradient(to right, #75CF55 0%, #CF1BC9 41%);
background: linear-gradient(to right, #75CF55 0%, #CF1BC9 41%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
<div id="catch_div">
<asp:Label ID="Label1" runat="server" Text="Label" class="catchphrase">Feel the rythem</asp:Label>
</div>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句