Firefox和IE中的线性渐变代码

时间:2014-04-01 06:07:15

标签: html css css3 colors linear-gradients

#woodwhite{position:absolute;left:1000px;width:345px;height:1400;top:0px;z-index:10;
background:-webkit-linear-gradient(-90deg, rgba(255,255,255,0),rgba(255,255,255,1));
background:-o-linear-gradient(-90deg, rgba(255,255,255,0),rgba(255,255,255,1));
background:-moz-linear-gradient(-90deg, rgba(255,255,255,0),rgba(255,255,255,1));
background:linear-gradient(-90deg, rgba(255,255,255,0),rgba(255,255,255,1));"}

我从w3获得的这些渐变代码并不适用于所有浏览器。 任何帮助,将不胜感激。 :)

2 个答案:

答案 0 :(得分:1)

看到这可能对你有所帮助

 .grad { 
      background-color: #F07575; /* fallback color if gradients are not supported */
      background: -webkit-linear-gradient(-90deg, rgba(255,255,255,0),rgba(255,255,255,1));
 /* For Chrome and Safari */
      background: -moz-linear-gradient(-90deg, rgba(255,255,255,0),rgba(255,255,255,1));
 /* For old Fx (3.6 to 15) */
      background: -ms-linear-gradient(-90deg, rgba(255,255,255,0),rgba(255,255,255,1));
 /* For pre-releases of IE 10*/
      background:-o-linear-gradient(-90deg, rgba(255,255,255,0),rgba(255,255,255,1));
 /* For old Opera (11.1 to 12.0) */ 
      background:linear-gradient(-90deg, rgba(255,255,255,0),rgba(255,255,255,1));
 /* Standard syntax; must be last */
    }

for more details

答案 1 :(得分:1)

background: #999; /* for non-css3 browsers */

filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#000000'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#000)); /* for webkit browsers */
background: -moz-linear-gradient(top,  #ccc,  #000); /* for firefox 3.6+ */