Responsive design ensures your site works across all devices. Here are modern patterns for building flexible layouts.
Mobile-First Approach#
Flexbox Patterns#
CSS Grid Patterns#
Container Queries#
Fluid Typography#
Responsive Images#
Responsive Tables#
Breakpoint System#
Best Practices#
Approach:
✓ Start mobile-first
✓ Use relative units (rem, em, %)
✓ Leverage flexbox and grid
✓ Use clamp() for fluid sizing
Testing:
✓ Test on real devices
✓ Use browser dev tools
✓ Check touch targets (44px+)
✓ Verify content reflow
Performance:
✓ Optimize images
✓ Use responsive images
✓ Minimize layout shifts
✓ Consider container queries
Conclusion#
Modern CSS provides powerful tools for responsive design. Use flexbox for one-dimensional layouts, grid for two-dimensional layouts, and container queries for component-level responsiveness. Fluid typography with clamp() reduces breakpoint management and creates smoother scaling.