2012-08-06 59 views
0

我有少的适用梯度的功能:检测使用less.js的旧版本,然后使用过滤器?

.linearGradient(@begin: black, @end: white, @switch : 100%) { 
    background: @begin; 
    background: -webkit-gradient(linear, 0 0, 0 100%, from(@begin), color-stop(@switch, @end)); 
    background: -moz-linear-gradient(top, @begin, @end @switch); 
    background: -o-linear-gradient(top, @begin, @end @switch); 
    background: linear-gradient(top, @begin, @end @switch); 
    filter: progid:DXImageTransform.Microsoft.gradient([email protected], [email protected],GradientType=0); /* IE6-9 */ 
} 

我希望能够来测试版本< IE10和使用其他过滤器只需使用CSS3。

编辑:其他问题 有没有测试浏览器的方法?

+0

关于附加问题:您可以使用条件注释测试IE <10,并且您可以使用某个CSS黑客测试WebKit:https://gist.github.com/1551173 – Ryan 2012-08-06 14:44:30

回答

0

不要打扰做测试; IE10不支持filter属性。