CSS Selector Level 3 » Negation pseudo-class

The negation pseudo-class takes as an argument a simple selector list (combinations not allowed). It matches an element which is not represented by the passed argument and this negation may not be nested within itself.

Syntax

Copy
:not(negation-selector) {
    /* declarations */
}

Example

Copy
a:not([rel="external"]) {
    color: red;
}
.

Try example in CodePen

Browser support

Platform Chrome Firefox Safari Edge Internet Explorer Opera
Desktop Yes (2.0) Yes (1.0) Yes (1.0) Yes (12.0) Yes (9.0) Yes (9.5)

Please wait a moment, the comments start loading now...
explorermozillachromesafariopera