CSS: descendant selector (space)

By Xah Lee. Date: . Last updated: .

Match Ancestor Tag (aka Descendant Combinator)

s1 s2

Match s2 that is nested inside s1 at any depth.

Each expression can be compound selector.

Can also be chained like this:

a b c

/* any span that's nested in div */
div span {
 color: red;
}
<div>
 <span>match</span>
 <p>
  <span>match</span>
 </p>
</div>

CSS. Selectors

Selector types
Simple selectors
Combinators
Selector list
Special selector
Misc