Performance: What is responsive design
MEDIUM IMPACT
Responsive design affects how quickly and smoothly a webpage adapts to different screen sizes, impacting user experience on various devices.
@media (max-width: 600px) { body { width: 100%; padding: 1rem; } } /* fluid layout with media queries */
body { width: 1200px; } /* fixed width layout */| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Fixed width layout | Low | Multiple on resize | High due to scrollbars | [X] Bad |
| Responsive fluid layout | Low | Single on resize | Low, smooth adaptation | [OK] Good |