Responsive Design: Media Queries, Fluid Layouts, and Breakpoints
How to build layouts that work across devices; practical breakpoint strategy.
On this page
30‑second interview answer
Responsive design means building UIs that adapt to different screens using fluid layouts, flexible media, and media queries when necessary. A good strategy is mobile-first: start with the smallest layout, then add breakpoints based on content needs—not based on specific devices.
Mobile-first approach
.card { padding: 12px; }
@media (min-width: 768px) {
.card { padding: 20px; }
}You start small and enhance.
Prefer fluid sizing over fixed
Use:
%for widthsremfor typography and spacingclamp()for fluid typography
Example:
h1 {
font-size: clamp(28px, 4vw, 48px);
}Breakpoints: choose by content
Bad reasoning:
- “iPhone breakpoint, iPad breakpoint…”
Good reasoning:
- “Layout breaks at ~680px because the card becomes cramped.”
Responsive images
- Use
max-width: 100%to prevent overflow.
img { max-width: 100%; height: auto; }Common pitfalls
- Hardcoding too many breakpoints
- Fixed heights causing overflow
- Using px everywhere for fonts
Mini Q&A
Q1: What is mobile-first?
- Base styles for small screens, add min-width queries.
Q2: When do you add a breakpoint?
- When the content/layout needs it.
Q3: Why use clamp()?
- Fluid typography without many breakpoints.
Summary checklist
- I use mobile-first.
- I prefer fluid layouts.
- My breakpoints are content-driven.
- Images never overflow containers.
Looking for structured, offline interview prep?
Free online lessons • Portable Amazon Kindle / Paperback
Frontend Interview Guide (2025 Edition)
By Rajesh Dhiman
Comprehensive preparation covering React internals, Web Performance, CSS architecture, and system design questions.
JavaScript Interview Guide
By Rajesh Dhiman
Deep dive into the Event Loop, microtask draining, closures, prototypal inheritance, and asynchronous execution patterns.
Note: All lessons on Frontend Interview remain completely free to read online. As an Amazon Associate, we may earn from qualifying purchases.
Written by Rajesh Dhiman
Authored by Rajesh Dhiman and engineered at Eunix Tech. Focused on deep-dive frontend engineering, JavaScript runtime internals, React architecture, and web performance.