CSS flexbox generator

Flexbox lays items out along one axis. justify-content distributes them along that axis and align-items positions them across it.

Features

  • Live previewEvery change redraws instantly.
  • Copy-ready CSSOnly the properties you set.
  • Runs in your browserNothing is uploaded and no account is needed.

How to use the flexbox playground

  1. Choose a direction.
  2. Adjust justification, alignment and wrapping.
  3. Copy the CSS.

Main axis and cross axis

The main axis follows flex-direction. When you switch to column, justify-content works vertically and align-items horizontally.

Frequently asked questions

Flexbox or grid?

Flexbox for a row or column of content; grid for rows and columns together.

Why does justify-content do nothing?

There may be no free space along the main axis.

Is gap supported in flexbox?

Yes, in all current browsers.

Related tools