Caffeinated Coder
Book an appointment
Lesson 08 · Layout

Flexbox

Normal flow stacks block boxes one under the next. display: flex lines them up in a row instead and lets you place them. Switch on one line of a .row rule at a time and watch three boxes move to exactly where a browser puts them: side by side, spaced with gap, spread with justify-content, centred with align-items, stretched with flex-grow, squeezed on a 300px screen, and finally wrapped onto a second line.

12 min9 steps5 questionsIntermediate
Fig 8 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.