This pseudo-class is called negation pseudo-class which takes a simple selector list as an argument (combination selectors aren't allowed). It matches the elements which are not represented by the passed arguments. Negations may not be nested within itself like this invalid example: E:not(:not(F))
# Syntax
:not(negation-selector1[, negation-selector2, …]) {
/* declarations */
}
# Example
a:not([rel="external"], [rel="nofollow"]) {
color: red;
}
In this example all links are going to be selected which have no rel
attribute with the attribute value external
or nofollow
. So you could style external or nofollow (marked) links different than regular ones.
# Browser support
For future browser support information, also check out caniuse.com (Negation pseudo-class).
# Usage statistics (Alexa Top 1,250,000 sites)
Due to an extreme price increase of our statistics provider the data collection was stopped in September 2018.