2012-08-06 55 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屬性。