可能重复:
CSS Selector that applies to elements with two classes
我有以下内容:
<div class="green-arrow current-plan span4">
<img src="/images/assets/green-arrow.jpg">
</div>
<div class="green-arrow plan-above span4">
<img src="/images/assets/green-arrow.jpg">
</div>
我想定位plan-above
所以它是display: none;
而不会影响plan-above
的其他实例(不是green-arrow
)。
答案 0 :(得分:4)
div.green-arrow.plan-above {
display: none;
}
答案 1 :(得分:1)
试试这个:
div.green-arrow.plan-above {
display: none;
}
此外,您可以使用CSS3排除几个逗号分隔的类
div.plan-above:not(.class, #id) {
//mark up
}