1
2
3
4
5
Advertisement
Directionrow
Wrapnowrap
Items5
Gap8px

About this generator

Build CSS Flexbox container layouts visually. Toggle every container property — flex-direction (4 modes), flex-wrap (3 modes), justify-content (6 options), align-items (5 options), align-content (6 options), gap — and see 1-12 child items rearrange live. Identity values (align-content: normal, gap: 0) are auto-omitted from the output.

5 framework exports + URL hash permalink. No login, no watermark, no paywall. Free and MIT-licensed.

?

How to use

01
Set flex-direction
Choose row or column to set the main axis. Reverse variants flip the order of items without touching the HTML.
02
Toggle flex-wrap
nowrap keeps all items on one line. wrap lets items spill to a new line when they run out of space.
03
Justify along the main axis
justify-content controls how items are distributed along the main axis — start, center, end, or space options.
04
Align on the cross axis
align-items positions items on the perpendicular axis. stretch fills the container; baseline aligns text baselines.
05
Adjust gap
The gap property sets space between flex items on both axes — cleaner than using margins on individual items.
06
Copy the CSS
Hit "Copy CSS" to grab the full property block and paste it straight into your stylesheet.
</>

CSS Flexbox syntax

PropertyDescription
flex-directionDefines the main axis: row (default) | column | row-reverse | column-reverse.
flex-wrapControls whether items wrap to new lines: nowrap | wrap | wrap-reverse.
justify-contentAligns items along the main axis: flex-start | center | flex-end | space-between | space-around | space-evenly.
align-itemsAligns items on the cross axis for a single line: stretch | flex-start | center | flex-end | baseline.
align-contentAligns wrapped lines on the cross axis (only applies when flex-wrap is enabled).
gapSets spacing between flex items. Shorthand for row-gap and column-gap.
</>

Flexbox snippets

Basic
display: flex;
Center
display: flex;
justify-content: center;
align-items: center;
Layout
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
align-items: flex-start;
gap: 16px;

Browser support

flexbox has excellent browser support — safe to use in production without any fallback or prefix (IE 11 has partial support).

Chrome v29+
Firefox v28+
Safari v9+
Edge v12+
IE v11+

Search CodeFronts

Loading…