CSS: descendant selector (space)
Match Ancestor Tag (aka Descendant Combinator)
aaa bbb-
Match any bbb that is nested inside aaa 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> <p> <span>match</span> </p> </div>
CSS, Selectors
simple selectors
- CSS: element selector (tag name)
- CSS: universal selector (* any tag)
- CSS: class selector
- CSS: ID selector
- CSS: attribute selector
- CSS: multiple attributes selector
selector list
relationship selectors (combinators)
- CSS: descendant selector (space)
- CSS: child selector (>)
- CSS: subsequent sibling selector (~)
- CSS: adjacent sibling selector (+)
special selector
- CSS: :root selector
- CSS: no child selector
- CSS: sibling selector
- CSS: pseudo-class selector (:)
- CSS: pseudo-element selector (::)
- CSS: negation selector (:not)
- CSS: is any of selector (:is, :where)
- CSS: :has descendant selector