Live Preview
See items rearrange the instant you change a property, so flexbox finally makes sense.
Build a CSS flexbox layout visually and copy the code. Change direction, alignment, wrapping, and gap, add or remove items, and watch the preview rearrange. Free, no signup.
Choose flex-direction, justify-content, align-items, and wrap from the menus.
Add or remove items and drag the gap slider. The preview rearranges live.
Copy the container CSS and paste it onto your own flex container.
Flexbox is the modern way to lay out a row or column of elements, but the property names are easy to mix up. Does justify-content run along the main axis or the cross axis? What does align-items actually do here? Reading about it only goes so far. Watching boxes move as you flip each setting is what makes it click.
This generator gives you a live container with sample items and a control for every flex property. Switch the direction, change how items are justified and aligned, turn wrapping on, and set the gap. The boxes rearrange instantly, and the matching CSS is written for you.
When the layout is right, copy the container CSS and apply it to your own element. It is great for navbars, card rows, button groups, and centering. Everything runs in your browser, so nothing is sent anywhere.
See items rearrange the instant you change a property, so flexbox finally makes sense.
Control flex-direction, justify-content, align-items, flex-wrap, and gap in one place.
Change the number of items to test how your layout behaves with more or fewer boxes.
Drag a slider to set the spacing between items and read the exact pixel value.
Get ready to paste container CSS, correctly formatted, that works everywhere.
Everything runs on your device. Nothing is uploaded and there is no signup.
More Developer tools you might find useful.
Common questions about CSS flexbox.