Visual CSS Flexbox playground with live preview. Configure container properties like flex-direction, wrap, justify-content, align-items, and gap. Add child items and fine-tune per-item flex-grow, flex-shrink, flex-basis, order, and align-self. Copy production-ready CSS instantly.
Click an item in the preview to edit its individual properties.
See your flexbox layout update in real time as you adjust container properties. Colored child boxes move and resize instantly so you can understand exactly how each property works.
Configure every flexbox container property: flex-direction, flex-wrap, justify-content, align-items, align-content, and gap. All standard values are available in dropdown menus.
Click any item in the preview to edit its individual flex-grow, flex-shrink, flex-basis, order, and align-self properties. Fine-tune how each child behaves within the flex container.
Get clean, copy-paste-ready CSS for both the container and individual items. One click copies everything to your clipboard, ready for your stylesheet.
CSS Flexbox is a powerful one-dimensional layout model designed for distributing space and aligning content within a container. Unlike older layout methods that rely on floats, tables, or inline-block, flexbox provides a clean, predictable way to arrange elements along a single axis -- either horizontally (row) or vertically (column).
The flex container is the parent element with display: flex. Its properties control the overall layout behavior: flex-direction sets the main axis, flex-wrap controls line wrapping, justify-content distributes space along the main axis, align-items aligns items on the cross axis, align-content distributes space between wrapped lines, and gap adds spacing between items.
Each direct child of a flex container is a flex item. Items can be individually configured with flex-grow (how much to grow relative to siblings), flex-shrink (how much to shrink), flex-basis (initial size before growing/shrinking), order (visual ordering), and align-self (overrides the container's align-items for that item).
Check out our other free CSS tools. Generate grid layouts, gradients, box shadows, and more -- all from your browser with no sign-up required.
CSS Grid Generator →