DaBlick DaBlick - 1 year ago 84
CSS Question

CSS pattern that matches when style is NOT present

I have a library (PrimeFaces) that adds a style to a

when a column is sortable. But I want to apply my own style when a column is NOT sortable: i.e. when that style is NOT in the

Is there a way to do a CSS selector for when a style is NOT present without making any other presumptions about what is/isn't in the list of the element's style classes?

That is, I need to do this strictly within CSS without modifying the HTML.

Answer Source

You can use :not() selector:

table th:not(.sortable){  }
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download