CSS Flexbox Generator
Explore Flexbox axes, wrapping and per-item sizing with a live preview, CSS and Tailwind output.
How to use
Choose a direction and wrapping mode, then adjust alignment and gap. Resize the container with the width and height inputs; small screens scroll the preview without changing its dimensions. Add up to twelve items and select each to edit grow, shrink, basis, alignment and order. Try Sample for wrapping cards. Copy CSS using the numbered item classes, or enable Tailwind output. Disable default omission to emit explicit flex values. Preview colors and padding are not exported.
FAQ
Why does align-content appear to do nothing?
align-content distributes flex lines across the cross axis of a wrapping container. Enable wrap and provide extra cross-axis space. With nowrap, use align-items or align-self to align individual items instead.
How do flex-grow, flex-shrink and flex-basis interact?
Basis supplies the initial main-axis size. Grow shares available space by ratio; shrink distributes a shortage using each item’s shrink factor and base size. Content minimum sizes can still prevent items from shrinking as far as expected.
Does order change keyboard navigation?
No. Order and reversed directions change visual layout, not DOM or tab order. Keep the source order meaningful. Numbered CSS selectors and preview labels always follow the original item sequence.
What is included in CSS and Tailwind output?
Both include exact container dimensions and selected flex properties. Default flex values are omitted unless requested; item rules use numbered classes on direct children. Tailwind output uses arbitrary properties for exact values. Demo colors, borders and padding are excluded.