【发布时间】:2020-02-17 04:59:40
【问题描述】:
我的 HTML:
<div class="first second">...</div>
<div class="third">...</div>
我的 CSS:
.first.second {
... // lots of properties setup here(50+ lines)
}
我的问题是:
Q1-对于.first.second 选择器,我认为它的意思是.first && .second,而不是.first || .second,我的理解正确吗?它的正式名称是什么,我找不到有关它的资源。
Q2- 我希望 third 类具有相同的属性设置,但避免设置新的类选择器,例如:
.third {
... // 50+ duplicated lines and take so much space on the css file
}
但我不能这样做:
.first.second.third {
...
}
因为它的意思是.first && .second && .third
那么代表(classA %% classB) || classC的最佳方式是什么
【问题讨论】: