selector
Nesting selector — CSS reference
The nesting selector represents the parent rule selector in native CSS nesting. An attached class such as &.selected matches the same element, while & .selected targets a descendant. Specificity follows the parent selector-list maximum, like :is().
Formal Syntax & Structure
css syntaxcss
&:hover { color: red; }Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>nesting-selector</title><style>body{margin:8px;background:white;color:black;font:16px/20px sans-serif}*{box-sizing:content-box}#a{color:black;&.selected{color:red}}</style><body><div id="a" class="selected">Selected</div></body></html>