Performance: Specificity rules
MEDIUM IMPACT
Specificity affects how quickly browsers determine which CSS rules apply, impacting style calculation and rendering speed.
.active-link { color: red; }
body div#main.content > ul li.item.active a:hover { color: red; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Highly specific complex selector | Many element checks | 0 (style only) | Low | [X] Bad |
| Simple class selector | Few element checks | 0 (style only) | Low | [OK] Good |