2012-12-04 30 views
4

我的android海豚瀏覽器9.0.1版的漸變屬性無法正常工作。 這裏是CSS:安卓海豚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,我不明白爲什麼它不起作用。

回答

1

可能是由混合的顏色格式(rgba和十六進制)造成的。
嘗試使用:

/* 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,10,0)是從#171000

+0

謝謝您的回答,但我不能,因爲該項目是已經死了:)(問題了檢驗這個被問了9個月前) Maby它會幫助別人 – NiCU

+0

我試過了,不幸的是它並沒有爲我工作。我試過hsl(),rgb()和#xxxxxx,它似乎並不喜歡任何漸變。它似乎支持所有三種顏色的語法,但對於普通的背景色。 – Timwi

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)); 

OR(如果上述方案不能再幫你可以試試)

background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FFFFFF), to(#8C8C8C)); 
background: -webkit-linear-gradient(bottom, #8C8C8C,#FFFFFF);