asp.net.ph

Skip Navigation LinksAbakada: Back to Basics > Language References > CSS Properties > Pseudo-Classes > not( ) Pseudo-class

:not( ) Pseudo-class


Represents elements that do not match a given argument.

Syntax

selector:not( ) {
   property: value
}

Possible Values

property Any valid CSS property.
value Any of the range of values available to the corresponding property.

Remarks

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 }

Example

External References

See Also


Need a break ?
Suggested Reading

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph.

If you have any question, comment or suggestion,
please send us a note