Flexbox Generator

Experiment with flex alignment and copy the flexbox CSS. Runs entirely in your browser.

Gap8px
1
2
3
4
CSS
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: stretch;
flex-wrap: nowrap;
gap: 8px;

Processed on your device. This file is never uploaded.

  1. 1Set the direction, then the alignment and wrap.
  2. 2Watch the row of items respond.
  3. 3Copy the flex CSS for your container.

See flexbox behave

Flexbox is the workhorse of one-dimensional layout, but its properties are easy to mix up — especially which axis justify-content and align-items act on. This playground lets you change each property and watch a live row of items react, which is the fastest way to build the right mental model.

Copy the container rule

The output is the CSS for the flex container: display, direction, justify-content, align-items, wrap and gap. Paste it onto a wrapper and its children arrange themselves accordingly. Everything runs on your device with nothing uploaded.

Frequently asked questions