Flexbox
Lay out boxes in a row or a column with Flexbox: axes, alignment, how flex-grow, flex-shrink and flex-basis share space, wrapping, gaps and real patterns.
In Phase 6 you placed boxes with normal flow, position and floats. Those tools were never designed for laying out a row of buttons or a set of equal-height cards, and people fought them for years. Flexbox (the Flexible Box Layout module) was built for exactly that job: arranging items in one direction at a time, a row or a column, and sharing out the space between them.
You'll start with the two ideas everything else depends on: the flex container and its two axes (main and cross). Then you'll align items along both axes, learn the exact maths the browser uses to grow and shrink items (flex-grow, flex-shrink, flex-basis and the flex shorthand), and meet the most common Flexbox bug of all: a long word or a wide child that refuses to shrink, fixed with min-width: 0.
The phase ends with wrapping, gap, order and the five patterns you will build again and again: a navbar, a media object, a row of cards, a sticky footer and the holy grail layout. Most examples print real measured positions, so you can change a value and check the browser's maths. Phase 8 (CSS Grid) handles layouts in two directions at once, and Topic 8.6 shows when to pick Grid over Flexbox.
Practise this phase
Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.