【问题标题】:Why my -webkit-background-clip: text ; is not working为什么我的 -webkit-background-clip: text ;不管用
【发布时间】:2021-09-06 13:57:33
【问题描述】:

我想为带有渐变的文本制作动画,但我的 -webkit-background-clip:text;不工作,请在这里检查什么问题:

h2{
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    left: 10%;
    top: 10%;
    font-size: 150%;
    font-weight: 800;
    color: white;
    width: 10%;
    height: 20%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 400%;
    background: linear-gradient( to right bottom, rgba(255,255,255,.9), rgba(255,30,80,1) 130%);
    animation: animate 10s linear infinite;
}
<div id="myname">
                <h2>Priyanshu Kumar</h2>
            </div>

【问题讨论】:

  • 你不需要它。 background-clipsupported almost universally 没有前缀。拿出来就可以了。
  • 不工作的兄弟
  • 为我工作,兄弟codepen.io/selfagency/pen/xxqowma
  • 你需要把背景放在背景剪辑之前
  • @selfagency chrome 仍然需要 -webkit- (在 chrome 中测试你的代码,它不会工作)

标签: html css django webkit


【解决方案1】:

@Temani Af 如果您的回答有效,谢谢。

我将背景放在背景剪辑之前,它对我有用。

【讨论】:

    猜你喜欢
    • 2022-07-10
    • 1970-01-01
    • 2017-07-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-29
    相关资源
    最近更新 更多