display: flex; flex-direction: row; justify-content: flex-start; align-items: stretch; flex-wrap: nowrap; gap: 12px;
How to use
Set direction and wrap
Choose flex-direction from the dropdown (row, row-reverse, column, or column-reverse) and pick a flex-wrap value. The preview boxes rearrange immediately, so you can confirm which way the main axis now runs.
Align with the two dropdowns
Select justify-content to distribute items along the main axis and align-items to position them on the cross axis. Drag the gap slider up to 48px and change Item count to test crowding.
Copy the CSS
Check the generated block, six declarations starting with display: flex, then press the copy button. Paste the rule onto your container element and every direct child becomes a flex item.
Why CSS Flexbox Generator
- Visual flexbox playground with live preview.
- Every common flex property as a control.
- Outputs spec-compliant CSS shorthand.