【问题标题】:Linear gradient with multiple backgrounds具有多个背景的线性渐变
【发布时间】:2016-07-11 18:30:08
【问题描述】:

具有多个背景的线性渐变的语法是什么?我的代码只是产生黄色而不是从黄色到粉红色的渐变?

background-color: rgba(red,1);
background:
    url(/src/stat/chevronRight.svg) 90% 45% no-repeat,
    linear-gradient(to bottom, rgba(yellow,1) 0%, rgba(pink,1) 100%);
background-size: 7px;

非常感谢

马丁

【问题讨论】:

    标签: css background gradient


    【解决方案1】:

    您可以将颜色设置为文字yellow,也可以使用RGBRGBAHexadecimal 颜色值。

    div {
      height: 100vh;
      background: url('http://placehold.it/150x150'), linear-gradient(to bottom, yellow, pink);
      background-repeat: no-repeat;
    }
    <div></div>

    【讨论】:

    • 您好,非常感谢您的帮助 Nenad,您的建议非常有效。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多