CSS: :where selector (is any of)
Selector :where
:where(s1, s2, etc)-
match any of the selectors s1, s2 etc.
s can be simple selector, compound selector or complex selector.
p { color: red; } /* 0 priority. does not override others */ :where(p) { color: blue; }
Example
:where(h1, h2, h3, h4) { border: solid 1px grey; }
Specificity
:where() has zero specificity.
Difference between :is() vs :where()
- specificity of
:is()is the highest specificity of the selectors inside it. - specificity of
:where()is 0.
Browser support
the selectors :is() and :where() are supported by all major browsers since 2022.