CSSCSS · Lesson 09

Flexbox

One-dimensional layout: direction, justify, align, gap, wrap and grow.

Video tutorialTrack course · freeCodeCamp
Speed
Next lesson
Watch 00:00 · 1 checkpoints Watch on YouTube More on this topic
Transcript & captions
4/4

Flexbox lays items out along one axis. justify-content works along the main axis, align-items along the cross axis.

Try it yourself
PropertyDoes
flex-directionrow | column
justify-contentspacing along the main axis
align-itemsalignment on the cross axis
flex-wrapallow items to wrap to new lines
gapspace between items
flex: 1let an item grow to fill space

Knowledge check

0/1 answered

In a row flex container, align-items controls…