Ágota Horváth Ágota Horváth - 1 year ago 81
CSS Question

CSS format class when it does not contains a string?

If I would like to format an element that has a given class, sometimes (very rare) I use:

.beigeButton[class~="enabledButton"] {


What if I want to give properties to an element only when it does NOT contain the given srting?
This does not work:

.beigeButton[class!="enabledButton"] {


How can I do that?

Answer Source

Use :not:

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