1
我要生成这个CSS代码CSS代码LESS:努力实现以较少的
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:focus,
.navbar-default .navbar-nav > .active > a:hover {
background-color: blue !important;
}
,但目前我生成这个CSS代码LESS:
.navbar-default .navbar-nav > .active > a {
background-color: blue !important;
}
.navbar-default .navbar-nav > .active > a:focus {
background-color: blue !important;
}
.navbar-default .navbar-nav > .active > a:hover {
background-color: blue !important;
}
这里是我的LESS代码:
.navbar-default {
//& always refers to the current selector.
.navbar-nav {
& >.active {
& > a {
background-color: blue !important;
&:focus {
background-color: blue !important;
}
&:hover {
background-color: blue !important;
}
}
}
}
}
啊我明白了,我应该使用逗号。非常感谢您的回答 :) – superkytoz 2015-02-11 19:48:35