Container and item behavior
Flexbox controls layout along a main axis and a cross axis. Direction changes which axis is primary, so justify-content and align-items can appear to exchange visual roles.
Configure a CSS Flexbox container and preview the layout immediately. Adjust direction, wrapping, alignment, spacing, and individual items, then copy the generated CSS into your project.
Flexbox controls layout along a main axis and a cross axis. Direction changes which axis is primary, so justify-content and align-items can appear to exchange visual roles.
Flexbox is well suited to one-dimensional rows or columns. CSS Grid is usually better when rows and columns must be controlled together.
Yes. Enable wrapping and adjust the available space and item settings.
Yes. The generator provides copy-ready layout styles.
.flex-container {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: stretch;
align-content: stretch;
}flex-start - Start of containerflex-end - End of containercenter - Center of containerspace-between - Even spacingspace-around - Equal space aroundspace-evenly - Equal space everywherestretch - Fill containerflex-start - Start of cross axisflex-end - End of cross axiscenter - Center of cross axisbaseline - Text baselineflex-grow - How much to growflex-shrink - How much to shrinkflex-basis - Initial sizeflex: grow shrink basis