html
  • css
  • firefox
  • google-chrome
  • 2012-05-21 186 views 3 likes 
    3

    我正在嘗試爲Chrome使用webkit漸變標記,但它根本不起作用。我在background:-moz-linear-gradient(#000, #888);的Firefox上試過它,它工作得很好。漸變不在Chrome中工作,但在Firefox中工作

    但與background: -webkit-gradient(linear, from(#000), to(#888));它不起作用。這裏是我的代碼位:

    echo "<tr style='background:-moz-linear-gradient(#000, #888); background: -webkit-gradient(linear, from(#000), to(#888));'><td width='65'><img src='images/avatar/defaultuser.jpg' height='65' width='65'>"; 
    

    回答

    10

    -webkit-gradient屬性已棄用。使用new gradient syntax

    background: -webkit-linear-gradient(#000, #888); 
    
    +0

    謝謝,這工作完美! :) – KaiZ

    3

    使用colorzilla gradient generator爲跨瀏覽梯度

    2

    使用這個代替:

    background: -webkit-linear-gradient(#000, #888); 
    

    -webkit-gradient是針對Chrome V2 ...

    1

    嘗試

    -webkit-linear-gradient(#000, #888); 
    
    1

    的webkit需要更多的東西:

    凡在Firefox中這樣寫:

    background:-moz-linear-gradient(top, #d39637, #000000); /* Firefox 3.6+ */ 
    

    鉻你寫:

    background:-webkit-gradient(linear, left top, left bottom, from(#d39637), to(#000000)); 
    
    1

    的Webkit有其自己的語法用於漸變

    background-image: -webkit-gradient(
         linear, 
         left bottom, 
         left top, 
         color-stop(0, rgba(0,0,0,1)), 
         color-stop(1, rgba(136,136,136,1)) 
        ); 
    
    1

    漸變顏色爲鉻和Mozilla

    背景圖像:-webkit梯度(線性,左下角,左上角,顏色 - 停止(0.10,#72abe0),顏色 - 停止(0.90,#eceaeb )); background-image:-moz-linear-gradient(center bottom,#72abe0 10%,#eceaeb 90%);

    相關問題