在我的android的dolphin浏览器9.0.1版中,渐变属性无法正常工作。 这是css:
position: absolute;
top: 0;
left: 0;
width: 320px;
height: 60px;
/* Mozilla Firefox */
background-image: -moz-linear-gradient(left, rgba(255,255,255,0) 66px, #171000 172px);
/* Webkit (Safari/Chrome 10) */
background-image: -webkit-gradient(linear, left top, right top, color-stop(0, rgba(17, 10, 0, 0)), color-stop(1, #171000));
/* Webkit (Chrome 11+) */
background-image: -webkit-linear-gradient(left, rgba(17, 10, 0, 0) 66px, #171000 172px);
/* W3C Markup, IE10 Release Preview */
background-image: linear-gradient(to right, rgba(17, 10, 0, 0) 66px, #171000 172px);
我是否必须为此浏览器添加其他规则?据我所知,它使用webkit,我不明白为什么它不起作用。
答案 0 :(得分:2)
<强> EITHER 强>
将color-stop(0, rgba(17, 10, 0, 0)), color-stop(1, #171000)
更改为
background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #a7cfdf), color-stop(100%, #23538a));
或(如果以上解决方案无效,那么您可以尝试一下)
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FFFFFF), to(#8C8C8C));
background: -webkit-linear-gradient(bottom, #8C8C8C,#FFFFFF );
答案 1 :(得分:1)
可能是由于颜色格式(rgba和hex)的混合造成的 尝试使用:
/* Webkit (Safari/Chrome 10) */
background-image: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(17, 10, 0, 0)), color-stop(100%, rgba(23, 16, 0, 1)));
或
/* Webkit (Safari/Chrome 10) */
background-image: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(17, 10, 0, 0)), color-stop(100%, rgba(17, 10, 0, 1)));
考虑到rgb(17,100,0)与#171000不同