Represents elements that do not match a given argument.
selector:not( ) {
property: value
}
property |
Any valid CSS property. |
value |
Any of the range of values available to the corresponding property. |
The :not( ) pseudo-class represents elements that do not match a list of selectors.
It prevents specific items from being selected, hence it is known as the negation pseudo-class.
The syntax for using the :not( ) pseudo-class is straightforward. A selector immediately precedes the pseudo-class.
For example, the following selector matches all <button> elements in an HTML document that are not enabled.
button:not([enabled]) { background-color: beige }