Free CSS Flexbox Generator
Experiment with flex direction, wrap, justify and align on live items — and copy the CSS.
A visual flexbox playground: set direction, wrap, justify-content, align-items and gap, change the number of items, and click an item to give it flex-grow. The CSS updates live, ready to copy.
Tip: click an item in the preview to toggle flex-grow: 1 on it.
.container {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: stretch;
gap: 12px;
}<div class="container">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
</div>🔒 Everything runs in your browser — nothing is uploaded.
Common uses
- Center a DivThe eternal question, answered visually.
- Navbar LayoutLogo left, links right.
- Equal-Height CardsCards that stretch to match.
- Learn FlexboxSee every property live.
- Space-BetweenPush items to the edges.
- Vertical StackColumn layouts with gaps.
How It Works
An interactive flexbox playground: switch flex-direction, wrap, justify-content and align-items and watch up to 10 live items rearrange instantly. Click any item to give it flex-grow: 1 and see how it claims space. The CSS updates live, ready to copy into your project.
- 1Set the containerDirection, wrap, justify-content, align-items, gap.
- 2Add itemsOne to ten numbered flex items.
- 3ExperimentClick an item to toggle flex-grow and see the effect.
- 4Copy the CSSThe container (and item) rules, ready to paste.
Everything runs in your browser — nothing is uploaded.
Related Tools
CSS Grid Generator
Visually design a CSS grid — tracks, units and gaps — and copy the generated CSS and HTML.
CSS Gradient Generator
Create linear, radial, and conic CSS gradients with a live preview. Copy the CSS with one click.
CSS Box Shadow Generator
Visual builder for CSS box-shadow with live preview, multi-layer stacking, color picker, inset toggle, and one-click copy. Includes Material, neumorphism, and glow presets.