Flexbox Generator
Set flex properties from dropdowns and watch the layout update live.
Every control maps to one flex container property and updates the preview instantly. justify-content distributes items along the main axis; align-items along the cross axis; and align-content only has a visible effect once items wrap onto multiple lines. The numbered boxes have varied heights so alignment is easy to see.
How to build a flex layout
Pick values from the dropdowns and drag the gap slider. The numbered boxes rearrange instantly so you can see exactly what each property does, and the container CSS below is ready to copy.
Main axis vs cross axis
justify-content aligns items along the main axis (the direction set by flex-direction), while align-items aligns them across it. Flipping flex-direction to column swaps which axis is which — the preview makes the difference obvious.