Nick Nick - 1 year ago 98
CSS Question

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

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 "dojoxGrid"? Something like:

.not(dojoxGrid) table{
border-top:1px solid #dddddd;
border-left:1px solid #dddddd;
border-right:1px solid #dddddd;
margin:1em auto;

Knu Knu
Answer Source

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

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

It's not supported by ≤ IE8 though.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download