Skip to main content

The :is() CSS pseudo-class function - CSS


Selector list as its argument, and selects any element that can be selected by one of the selectors in that list. This is useful for writing large selectors in a more compact form.

Demo

Heading 1

Heading 2

Heading 3

HTML

<h1>Heading 1</h1>
<h2 class="success">Heading 2</h2>
<h3>Heading 3</h3>

CSS

:is(h1, h2, h3).success {
  color: red;
}

Comments