:is()

The :is() pseudo-class matches any element in its selector list, condensing repetitive selectors.

Since CSS4 Spec ↗

Syntax

:is(s1, s2, s3) { }

Examples

:is(h1, h2, h3) {
  margin-block: 0.5em;
}
.article :is(ul, ol) li { line-height: 1.6; }
Output
Applies the same vertical margin to all three heading levels and consistent line-height to list items in either list type.

Notes

Reduces selector duplication. Its specificity equals the most specific selector in the list (unlike :where which is zero). A non-matching item in the list does not invalidate the whole selector.

Browser & runtime support

EnvironmentSince version
chrome 88
firefox 78
safari 14
edge 88

See also