concept

selector-invalidation — CSS reference

An invalid selector in an ordinary list generally discards the rule, even when another branch could match. A separate valid rule can still apply. Some historical vendor-prefixed pseudo-elements are an exception.

Formal Syntax & Structure

css syntaxcss
valid-selector, :unknown { … }

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); }.other { color: rgb(0, 96, 80); } .notice, :not-a-real-pseudo { color: red; }</style></head><body><p id="a" class="sample notice">A</p><p id="b" class="sample notice other">B</p></body></html>
CSS Reference