:is()
W3C CSS Snapshot 2026
Match any option in a selector list. Its specificity comes from the most specific argument.
On this page
Syntax and values
| Value or syntax | What it does |
|---|---|
section :is(h2, p) | Matches headings and paragraphs inside sections. |
Try the example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>:is()</title>
<style>
section :is(h2, p) { color: teal; }
</style>
</head>
<body>
<section>
<h2>Workshop</h2>
<p>Registration opens Monday.</p>
<hr>
<p>Bring a notebook.</p>
</section>
<p>Outside the section.</p>
</body>
</html>
What to expect The heading and both paragraphs within the section change.