【问题标题】:Is it possible to set horizontal gradient to text via CSS? (left letter one colour, right - another colour) [duplicate]是否可以通过 CSS 将水平渐变设置为文本? (左字母一种颜色,右字母另一种颜色)[重复]
【发布时间】:2017-02-14 12:08:54
【问题描述】:

是否可以通过 CSS 将水平渐变设置为文本? (左字母一种颜色,右字母另一种颜色)。

【问题讨论】:

    标签: css text gradient


    【解决方案1】:

    是的。

    h1 {
      font-size: 72px;
       background: -webkit-linear-gradient(left, red , yellow);
       background: -o-linear-gradient(right, red, yellow);
       background: -moz-linear-gradient(right, red, yellow);
       background: linear-gradient(to right, red , yellow); 
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    <h1>Hello World</h1>

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-15
    • 1970-01-01
    • 2014-04-24
    • 1970-01-01
    相关资源
    最近更新 更多