html
  • css
  • firefox
  • google-chrome
  • 2012-05-21 118 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%);

    相关问题