How to use Flexbox Generator

Change the flex properties and watch the items move, then copy the CSS.

  1. Adjust the controls — the preview updates live.
  2. Copy the generated CSS.
  3. Paste it into your stylesheet.

About Flexbox Generator

Flexbox lays items out along one axis. justify-content positions items along the main axis, align-items along the cross axis, and flex-wrap lets them flow onto new lines.

gap sets the space between items without margins. Trying the options in a live preview is the quickest way to see how each property interacts before copying the CSS.

Questions

How do I centre something with flexbox?

On the container use display: flex; justify-content: center; align-items: center.

When should I use grid instead?

Use grid when you need rows and columns at the same time; flexbox is best for a single row or column.

Ratings & reviews

No ratings yet. Signed-in users can rate this app.