Layout systems · mid
Responsive design, units and container queries
Responsive design starts mobile-first with fluid units (rem, %, fr, clamp(), dvh), adds media queries for the page and container queries for components, so a card adapts to its own width, not the screen's.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- rem for type and spacing (respects user font size); em for things relative to the parent font; % and fr for fluid widths.
- 100vh is wrong on mobile browsers with toolbars; use dvh / svh / lvh.
- clamp(1rem, 2.5vw, 1.5rem) for fluid type.
- Container queries: container-type: inline-size on the parent, @container (min-width: 400px) on children; container units cqi.
- Modern CSS: :has() (parent selector), native nesting, logical properties (margin-inline), view transitions.
The red pen
Common traps: mistake → fix
Mistake: "use px everywhere"
Fix: users who raise the browser font size get a broken layout.
Mistake: "media queries are enough for components"
Fix: a component in a sidebar needs container queries.
Easy to hard
Questions interviewers ask, easy to hard
- How do you approach responsive design?
- What do container queries solve?
- What is :has() useful for?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.