CSS Flexbox Generator
Build a CSS flexbox layout visually: flex-direction, justify-content, align-items, flex-wrap and gap on the container, plus per-child flex-grow, flex-shrink and flex-basis, all with a live preview and copyable CSS.
🔒 Processed entirely in your browser — nothing you enter here is ever uploaded.
Result
A flexbox layout has two separate rulebooks — properties on the container (flex-direction, justify-content, align-items, flex-wrap, gap) and properties on each child (flex-grow, flex-shrink, flex-basis) — and mixing them up is the most common source of "why isn't this centering / growing / wrapping the way I expect" bugs. This generator puts both rulebooks on screen at once: change any container control or any child's own fields and three numbered, color-coded boxes update immediately, so cause and effect stay visible.
The container side covers every layout axis: pick a direction, choose how children are distributed along the main axis with justify-content, align them on the cross axis, decide whether they wrap onto new lines, and set a gap instead of margin hacks between them. The child side is just as real: add boxes up to eight, remove down to two, and give any of them their own flex-grow, flex-shrink and flex-basis — the generator only prints a per-child CSS rule when at least one of those differs from the browser default, so the copied code never pads itself with flex-grow: 0 on boxes that do not need it.
Preset pages jump straight to the layouts people actually search for by name: how to center a div (the single most-asked CSS layout question, solved with justify-content and align-items both set to center), a logo-left links-right navbar, equal-width flexible columns via flex-grow, and a side-by-side comparison of space-between against its close relatives space-around and space-evenly.
Like every tool on this site, the generator is free and runs entirely in your browser: no upload, no account, and it keeps working offline once the page has loaded.