浏览器特定的规则

时间:2014-05-19 17:11:06

标签: css css3 less

我是新手少,我试图不在Firefox中显示大纲。这是我的代码当前代码,但我不确定如何实现下面的css hack。这样做的正确方法是什么?

.nav_container{
    display:block;
    background-color:rgba(0,0,0,0.75);
    border-bottom:solid 2px #eee7d9;
    outline: 2px solid #344656;

@-moz-document url-prefix() { 
    .selector {
        color:lime;
    }
}

text-align: center;
&:after{
    display:block;
    content:"";
    border-bottom: 2px solid #e84849;
}

}

1 个答案:

答案 0 :(得分:0)

编译@-moz-document规则时,Less不保留选择器的嵌套,另请参阅:https://github.com/less/less.js/issues/2104。要解决您的问题,您应该再次在@-moz-document规则中定义选择器关系。请尝试以下少量代码:

.nav_container{
    display:block;
    background-color:rgba(0,0,0,0.75);
    border-bottom:solid 2px #eee7d9;
    outline: 2px solid #344656;

text-align: center;
&:after{
    display:block;
    content:"";
    border-bottom: 2px solid #e84849;
}

}

@-moz-document url-prefix() { 
     .nav_container .selector {
        color:lime;
    }
}