【问题标题】:Can't pin point this selector无法定位此选择器
【发布时间】:2012-01-16 01:42:26
【问题描述】:

我有一个像这样的 div

<div class="listItem jrFeatured">

我希望它保留 listItem 的所有 CSS,但有 jrFeatured 的额外 CSS

但我不希望所有 jrFeatured 都不同,只有 listItem 中的那个不同

我真的误解了这一点还是有办法实现我想要的?

【问题讨论】:

    标签: html css css-selectors


    【解决方案1】:
    .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 */
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-01
      • 1970-01-01
      • 2016-09-26
      • 2019-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多