Performance: Font size
MEDIUM IMPACT
Font size affects the rendering speed and layout stability of text content on the page.
html { font-size: 100%; } body { font-size: 1rem; } h1 { font-size: 2rem; } p { font-size: 0.875rem; }body { font-size: 16px; } h1 { font-size: 32px; } p { font-size: 14px; }| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Fixed pixel font sizes | Minimal | Multiple on resize/zoom | Moderate | [X] Bad |
| Relative font sizes (rem, em) | Minimal | Single or none on resize | Low | [OK] Good |