Caffeinated Coder
Book an appointment
Lesson 11 · Layout

Responsive design and media queries

One page has to work on a 360px phone and a 1024px laptop window. Add the viewport meta tag so the phone lays the page out at its own width, write a one-column layout first, then use a media query, @media (min-width: 700px), to add two columns only on wide screens. Watch the browser test each screen's width, split the laptop into 2fr and 1fr columns, and switch back the moment the window is dragged below 700px.

11 min10 steps5 questionsIntermediate
Fig 11 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.