【问题标题】:Value Error : background-image bottom is not a color value )值错误:背景图像底部不是颜色值)
【发布时间】:2014-05-06 12:24:30
【问题描述】:

有人可以帮我纠正这个问题吗?,我得到的错误是:值错误:背景图像底部不是颜色值)

.btn {
    padding:5px 10px; border-radius:5px; color:#FFF; text-shadow: 1px 1px #333;
    box-shadow: inset 0 1px 0 0 #94bee0; border: none;
    background-image: linear-gradient(bottom, rgb(42,112,166) 21%, rgb(66,136,190) 61%);
    background-image: -o-linear-gradient(bottom, rgb(42,112,166) 21%, rgb(66,136,190) 61%);
    background-image: -moz-linear-gradient(bottom, rgb(42,112,166) 21%, rgb(66,136,190) 61%);
    background-image: -webkit-linear-gradient(bottom, rgb(42,112,166) 21%, rgb(66,136,190) 61%);
    background-image: -ms-linear-gradient(bottom, rgb(42,112,166) 21%, rgb(66,136,190) 61%);

    background-image: -webkit-gradient(
        linear,
        left bottom,
        left top,
        color-stop(0.21, rgb(42,112,166)),
        color-stop(0.61, rgb(66,136,190))
    );
}

【问题讨论】:

    标签: css


    【解决方案1】:

    您的无前缀linear-gradient() 语法需要更新以匹配the latest spec,它具有不同的语法来指定方向:

    background-image: linear-gradient(to top, rgb(42,112,166) 21%, rgb(66,136,190) 61%);
    

    请注意,to top 实际上取代了bottom,即使它是相反的方向。有关说明,请参阅 this answer。

    至于前缀值,不用担心:它们是非标准的,因此无法验证。

    【讨论】:

    • 谢谢你,博尔特时钟先生
    猜你喜欢
    • 2017-10-13
    • 2015-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-01
    • 2021-09-09
    相关资源
    最近更新 更多