concept
Css nesting — CSS reference
Native CSS nesting expresses a related selector within a parent style rule. The nesting selector represents the parent selector context; it is not textual concatenation and specificity has defined rules. Keep nesting shallow enough to understand the resulting selector. Here only the direct child matches.
Formal Syntax & Structure
css syntaxcss
.panel { & > .label { color: blue; } }Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>css-nesting</title><style>body{margin:8px;font:16px/1.5 sans-serif;color:black;background:white}#a{box-sizing:border-box}.panel{& > .label{color:blue}}</style><body><div class="panel"><span id="a" class="label">Direct</span><div><span id="b" class="label">Nested</span></div></div></body></html>