Flexbox playground
Change flex-direction, justify-content, align-items, wrap and gap on a real flex container.
Flexbox lines up the children of a container. The container has display: flex, and its children are the flex items.
justify-content places the items along the main direction, align-items places them across it, gap adds space between them, and flex-wrap lets them move to the next line when the row is full.
Things to try
- Click each justify-content value. Which one spreads the boxes out evenly?
- Change align-items to center and then flex-end. Which direction does it move the boxes?
- Add boxes until the row is full, then turn flex-wrap on.
- Switch flex-direction to column. Which property now controls the vertical placement?