Performance: Child selector
LOW IMPACT
This affects how quickly the browser matches CSS rules to elements, impacting style calculation and rendering speed.
div > ul > li { color: red; }div ul li { color: red; }| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Descendant selector (e.g., div ul li) | High (matches many elements) | 0 (no layout change) | Low | [✗] Bad |
| Child selector (e.g., div > ul > li) | Low (matches fewer elements) | 0 (no layout change) | Low | [✓] Good |