concept

forgiving-selector-list — CSS reference

A forgiving list discards invalid branches while retaining valid alternatives. An ordinary selector list is not forgiving. If no valid alternatives survive, nothing matches.

Formal Syntax & Structure

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