Universal Selector (*)
W3C CSS Snapshot 2026
Use * to match any element. Combine it with another selector to limit the match to one part of the page.
On this page
Syntax and values
| Value or syntax | What it does |
|---|---|
* | Matches all elements in the current context. |
.panel * | Matches every descendant of an element with class panel, at any depth. |
Try the example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Universal Selector (*)</title>
<style>
.panel * { outline: 1px dashed teal; outline-offset: 2px; }
</style>
</head>
<body>
<section class="panel"><h2>Workshop</h2><p>Bring a <strong>notebook</strong>.</p></section>
<p>Outside the panel.</p>
</body>
</html>
What to expect The heading, paragraph, and bold word inside the panel have outlines. The final paragraph stays unchanged.