TOOLDENDEVELOPERON-DEVICE
CSS Flexbox Generator
Build a flexbox layout visually, direction, justification, alignment, wrapping and gap, and copy the generated CSS and HTML into your project.
HOW TO USE
- 1Choose the flex direction: row, row-reverse, column or column-reverse.
- 2Set how items are distributed on the main axis with justify-content and on the cross axis with align-items.
- 3Toggle wrapping and the gap between items, and set how many boxes the layout holds.
- 4Copy the CSS and HTML with one click. The CSS targets .flex-container and the HTML matches.
EXAMPLE
INPUT
direction: column, justify: space-between, align: center, wrap: nowrap, gap: 12px
OUTPUT
display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 12px;
FAQ
What is the difference between justify-content and align-items?
justify-content distributes items along the main axis (the flex-direction), while align-items places them along the cross axis. In a row, justify is horizontal and align is vertical.
Why does align-items: stretch not seem to do anything?
Stretch is the default and only shows when items have no explicit height. The preview boxes are sized, so give items a height and use center, flex-start or flex-end to see cross-axis changes clearly.
When should I use flex-wrap?
With wrap, items flow onto new lines when the container is too narrow. It is the easiest way to make a flex layout responsive without media queries.
Does the generator produce a responsive layout?
The code is a single flex layout. For breakpoints, wrap the generated CSS in a media query or adjust the gap and wrap rules there.
Is my data sent anywhere?
No. All code is generated entirely in your browser, your settings never leave your device.