Imagine that you have following HTML structure:
|
|
Now we want to set some styles on all <c> elements except the one which is inside <d> element.
For the sake of this example we will make let elements have a red background.
Solution to this problem is very easy.
We can use :not() and give him a path to the element that we want to ommit.
|
|
As a result our structure will have 3 <c> elements painted red:
|
|
If you want to have more than one selector, you can cascade :not().
Let’s say we want to skip <c> elements in both <d> and <e> elements.
To achieve that we can do following:
|
|
Now we will have only 2 <c> elements painted red:
|
|