:is()
A CSS pseudo-class that matches any element matching one of the selectors in its list, such as :is(header, form) input.
In more detail
It shortens long selector lists and uses a forgiving selector list. Its specificity equals its most specific argument, so one ID inside raises the whole selector.
Related terms
- :where() — A CSS pseudo-class that works like :is() but always adds zero specificity, whatever its arguments.
- specificity — The weight the browser gives a CSS selector, used to decide which rule wins when two set the same property.
- forgiving selector list — A selector list in which an invalid or unsupported selector is simply ignored instead of making the whole rule fail.
Taught in
- Modern Selectors: :has(), :is(), :where() And Nesting Standards — Frontend Architecture & Web Platform