Lesson 20 / 25
Best practices checklist
A comprehensive guide to responsive design principles, patterns, and pitfalls to avoid.
Responsive design checklist
✓ Viewport meta tag present. ✓ Mobile-first CSS approach. ✓ Flexible widths (%, em, rem). ✓ Media queries for key breakpoints. ✓ Images responsive (max-width: 100%). ✓ Touch-friendly buttons (44x44px). ✓ No fixed-width layouts. ✓ Test at 320px, 768px, 1024px, 1440px. ✓ Core Web Vitals optimized. ✓ WCAG 2.1 AA contrast ratio.
Common pitfalls to avoid
❌ Omitting viewport meta tag. ❌ Fixed widths and pixel-based layouts. ❌ Hover-only interactions. ❌ Text too small (< 14px on mobile). ❌ Small tap targets (< 44px). ❌ Unoptimized images (images larger than needed). ❌ Not testing on real devices. ❌ Assuming all screens are 16:9.
Minimal responsive CSS template
Start every project with these essentials.
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { html { font-size: 18px; } }Progressive enhancement
Start with semantic HTML, enhance with CSS, add JavaScript for interactivity. This ensures the site works even if CSS or JS fails.