:not 选择器是css3里面的

 

:not([class]){color:red;}  // 没有class属性的元素都设置为红色

 

p:not([class]){color:red;} // 没有class属性的p元素都设置为红色

 

:not(p) {color:red;} // 全都是红色,P也变红,除非另外设置P的颜色

 

p{color:yellow;}

:not(p){color:red;}  // 所有非P红色, P黄色

相关文章:

  • 2021-12-15
  • 2021-07-22
  • 2021-11-30
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-12-28
猜你喜欢
  • 2022-01-18
  • 2022-02-08
  • 2021-05-11
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案