Descendant Combinator (space)

W3C CSS Snapshot 2026

A space matches elements inside another element, at any nesting depth.

On this page

Syntax and values

Value or syntaxWhat it does
section pMatches paragraphs anywhere inside a section.

Try the example

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Descendant Combinator (space)</title>
  <style>
section p { color: teal; }
  </style>
</head>
<body>
<section>
  <p>Direct child</p>
  <div><p>Nested paragraph</p></div>
</section>
<p>Outside the section</p>
</body>
</html>

What to expect Both paragraphs inside the section turn teal.

Official references