pseudo-class

:not() — CSS reference

Matches when none of its arguments match. Its list is not forgiving, and the most specific argument determines its contribution.

Formal Syntax & Structure

css syntaxcss
:not(selector-list)

Working Example

Example Snippetcss
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Selector lab</title><style>:where(.sample) { color: rgb(32, 32, 32); }p:not(.muted) { color: rgb(0, 96, 80); }</style></head><body><p id="a" class="sample notice">A</p><p id="b" class="sample muted">B</p></body></html>
CSS Reference