使用-ms-filter转义LESS的语法:“codeNeedsVar”;

时间:2012-08-21 09:13:32

标签: firefox explorer favorites

我需要能够将变量变为

/* Opacity */
.opacity(@opacity: 0.35){
    -moz-opacity: @opacity;
    -khtml-opacity: @opacity;
    -webkit-opacity: @opacity;
    opacity: @opacity;
    @ieOpacity: @opacity * 100;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=@ieOpacity)";
    filter: ~"alpha(opacity=@ieOpacity)";
}

如果符合此规则,代码在.css文件(Opacity=@ieOpacity)

中将如下所示

1 个答案:

答案 0 :(得分:0)

答案很简单,添加@{var}以便少知道它的变量而不是文本

-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=@{ieOpacity})";