Performance: Relative units
MEDIUM IMPACT
Relative units affect how CSS scales and adapts during page load and resizing, impacting layout stability and rendering speed.
body { font-size: 1rem; margin: 1.25rem; }body { font-size: 16px; margin: 20px; }| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Fixed px units | Normal | Multiple on resize/zoom | Moderate | [X] Bad |
| Relative units (rem, em, %) | Normal | Single or none on resize/zoom | Low | [OK] Good |