If you have this:
<div class="a x">Foo</div>
<div class="b x">Bar</div>
<div class="c x">Baz</div>
And you only want to select the elements which have .x
and (.a
or .b
), you could write:
.x:not(.c) { ... }
but that's convenient only when you have three "sub-classes" and you want to select two of them.
Selecting only one sub-class (for instance .a
): .a.x
Selecting two sub-classes (for instance .a
and .b
): .x:not(.c)
Selecting all three sub-classes: .x