How to create a css rule for all elements except one class?

前端 未结 3 861
慢半拍i
慢半拍i 2020-12-04 17:22

I have created a CSS stylesheet for my project. Is there any way I can create a css rule that applies to all table elements EXCEPT table elements belonging to the class \"do

相关标签:
3条回答
  • 2020-12-04 17:42

    The safest bet is to create a class on those tables and use that. Currently getting something like this to work in all major browsers is unlikely.

    0 讨论(0)
  • 2020-12-04 17:51

    The negation pseudo-class seems to be what you are looking for.

    table:not(.dojoxGrid) {color:red;}
    

    It's not supported by ≤ IE8 though.

    0 讨论(0)
  • 2020-12-04 17:52

    Wouldn't setting a css rule for all tables, and then a subsequent one for tables where class="dojoxGrid" work? Or am I missing something?

    0 讨论(0)
提交回复
热议问题