选择一类我有这对每个输入标签的形式:在萨斯
<label>My Label</label>
我的风格它:
label {
&:before {
background-color: red;
}
}
我一个类添加到每个标签:
<label class="blue">My Label</label>
<label class="yellow">My Label</label>
如何在Sass中为每个课程选择前?
label {
&:before {
background-color: red;
&.blue {
background-color: blue; //???????
}
}
}
请注意,我之所以用::before
选择的东西是不是改变一个标签背景颜色比较复杂,我刚刚用这个作为一个简单的例子。
漂亮的确定需要选择是'标签:before'和'label.blue :在'之前,而不是'label.blue'。 – cimmanon 2014-09-23 17:40:59