2059↗learn.

Flexbox lab

Adjust the container properties, inspect the layout and copy the CSS.

Container properties

LIVE PREVIEWMAIN AXIS →
01
02
03
04

In a row, justify-content distributes space horizontally. align-items handles the vertical cross axis.

TRY A LAYOUT

Your CSS

Items keep their basis and do not shrink. The preview adds padding, colors and a fixed height for comparison.

No account needed. Your shared link stores only the control values.

Understanding the axes

The main axis follows flex-direction; the cross axis runs across it. Switch to column to see how justify-content changes direction. Add items to compare wrap and nowrap.

Read the Flexbox lesson

Go deeper: MDN Flexbox concepts ↗ · When should you use Grid instead?

Search by topic, concept, or language. Escape to close.

Reset local data?