我有一个看起来像这样的div
<div class="listItem jrFeatured">
我希望它保留listItem
的所有CSS,但为jrFeatured
添加其他CSS
但我不希望所有jrFeatured
仅与listItem
我真的误解了这个,还是有办法实现我的目标?
答案 0 :(得分:4)
.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 */
}