Tailwind Class Sorter
Sort Tailwind classes and detect conflicting utilities with a winner explanation.
OpenTry every flex alignment combination on real boxes and copy the container rule that matches.
Choose row, column or a reversed direction for the main axis.
Pick justify-content and align-items from the dropdowns.
Decide whether items wrap and drag the gap between 0 and 48 px.
Copy the .container CSS or download it as flex.css.
You want three cards spaced evenly across a row on desktop and stacked on mobile, and you can never remember whether that is justify-content or align-items. Rather than reload the browser twenty times, set the values here and watch the boxes respond.
The generator controls the flex container. Pick justify-content (flex-start, center, flex-end, space-between, space-around or space-evenly), align-items (stretch, center, flex-start, flex-end or baseline), flex-direction (row, row-reverse, column or column-reverse) and flex-wrap (nowrap, wrap or wrap-reverse), then set gap from 0 to 48 px. Three numbered boxes in the preview rearrange on every change, and the output is a single .container rule with display: flex and those five properties.
The usual source of confusion is direction. justify-content always works along the main axis, so once you switch to column it controls vertical spacing and align-items takes over horizontally. Test that switch in the preview before you write a media query. Properties on the children, such as flex-grow or order, are not part of this tool. When the layout is really two-dimensional, the CSS grid generator is the better starting point, and for spacing tokens shared across rows and stacks see the gap and spacing snippet tool.
The CSS is assembled in the page as you change the controls, so you can copy or download flex.css right away.
Keyboard shortcut
Answers for this tool. For site-wide help, open the FAQ hub.
In a column the main axis is vertical, so space-between needs spare height to distribute. If the container is only as tall as its content there is nothing to share. Give the container a height or min-height.
No. The generator only writes container properties. Add flex: 1 or similar rules to the children yourself.
Yes. Flex gap is supported in all current versions of Chrome, Edge, Firefox and Safari. Only very old Safari releases (before 14.1) ignore it.