CSS Flexbox Playground
Learn and experiment with CSS Flexbox. Adjust container properties and watch the layout update live.
Features
How to Use
1. Adjust container properties (direction, wrap, justify-content, align-items).
2. Add or remove flex items.
3. See the layout update live and copy the CSS.
About this tool
Flexbox arranges items along one axis — a row or a column — and distributes space between them. The trouble is that a handful of properties interact: flex-direction sets the main axis, justify-content aligns items along it, align-items aligns them across it, flex-wrap decides whether they move to a new line, and gap sets consistent spacing. This playground lets you change each property and immediately see how coloured boxes rearrange, which is the quickest way to build intuition or debug a layout that is not behaving. Add or remove items to test wrapping, then copy the generated CSS for the container. For two-dimensional layouts where rows and columns must line up, CSS Grid is usually the better tool.