Responsive Design: Stop Fighting Screen Sizes
The most common mistake in responsive design is choosing breakpoints based on specific devices. Devices change every year. Instead, design for content — add a breakpoint when the layout breaks.
Recommended Breakpoints
/* Mobile-first approach (start small, add complexity) */
/* Base styles: mobile (320px+) */
.container { padding: 16px; }
/* Small tablets (640px+) */
@media (min-width: 640px) {
.container { padding: 24px; }
}
/* Tablets / small laptops (768px+) */
@media (min-width: 768px) {
.grid { grid-template-columns: repeat(2, 1fr); }
}
/* Laptops (1024px+) */
@media (min-width: 1024px) {
.grid { grid-template-columns: repeat(3, 1fr); }
}
/* Desktops (1280px+) */
@media (min-width: 1280px) {
.container { max-width: 1200px; margin: 0 auto; }
}Tailwind CSS Breakpoints
| Prefix | Min Width | Targets |
|---|---|---|
sm: | 640px | Small tablets |
md: | 768px | Tablets |
lg: | 1024px | Laptops |
xl: | 1280px | Desktops |
2xl: | 1536px | Large screens |
Breakpoint-Free Responsive Design
Modern CSS can handle responsiveness without media queries:
/* Auto-responsive grid — no breakpoints needed */
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 16px;
}
/* Fluid typography — scales with viewport */
.title {
font-size: clamp(1.5rem, 4vw, 3rem);
}
/* Container queries — respond to parent, not viewport */
.card-container {
container-type: inline-size;
}
@container (min-width: 400px) {
.card {
display: flex;
flex-direction: row;
}
}The clamp() Function
/* clamp(minimum, preferred, maximum) */
font-size: clamp(1rem, 2.5vw, 2rem);
padding: clamp(16px, 4vw, 64px);
width: clamp(200px, 50%, 600px);
/* Replaces:
font-size: 2.5vw;
with a minimum of 1rem and maximum of 2rem */Testing Responsive Design
- Chrome DevTools → Device toolbar (Ctrl+Shift+M)
- Test at 320px, 375px, 768px, 1024px, 1440px
- Test landscape orientation on mobile
- Test with zoom (200%, 400%)
- Use real devices when possible — emulators miss touch behavior
Common Mistakes
- Using
max-widthqueries (desktop-first) — usemin-width(mobile-first) - Targeting specific devices ("iPhone 15 breakpoint") — target content needs
- Hiding content on mobile instead of reorganizing it
- Not testing with real text (German words are longer than English)
- Fixed widths instead of fluid/percentage-based layouts
Check your design: Color Contrast Checker — ensure readability across all screen sizes.