CSS Flexbox Playground

Experiment with flex container and item properties visually and copy the resulting CSS.

Runs in your browser. Your input is processed on your device and is not uploaded to our server.

Click an item to edit its flex properties.

How to use the CSS Flexbox Playground

  1. Change direction, wrapping, justification, alignment and gap.
  2. Add items and set grow, shrink, basis and order per item.
  3. Copy the CSS.

Flexbox lays items out in one dimension. justify-content distributes space along the main axis; align-items aligns items on the cross axis. For two-dimensional layouts use CSS Grid.

Frequently asked questions

Flexbox or Grid?
Flexbox for one-dimensional rows or columns of content; Grid for two-dimensional layouts.