selector

descendant — CSS reference

Targets B at any descendant depth of A. Whitespace between selectors expresses ancestry, not necessarily direct parenthood.

Formal Syntax & Structure

css syntaxcss
A B

Working Example

Example Snippetcss
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Selector lab</title><style>:where(.sample) { color: rgb(32, 32, 32); }section p { color: rgb(0, 96, 80); }</style></head><body><section><div><p id="a" class="sample">A</p></div></section><p id="b" class="sample">B</p></body></html>
CSS Reference