我有一个看起来像这样的div
<div class="listItem jrFeatured">
我希望它保留 listItem
的所有 CSS,但为 jrFeatured
添加额外的 CSS
但我不希望所有的 jrFeatured
只与 listItem
中的不同
我真的误解了这一点还是有办法实现我想要的?
最佳答案
.listItem {
/* code for item(s) matching listItem class */
}
.jrFeatured {
/* code for item(s) matching jrFeatured class */
}
.listItem.jrFeatured {
/* code for item(s) matching BOTH listItem and jrFeatured classes */
/* based on your question, this sounds like what you're looking for */
}
关于html - 无法定位此选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8871742/