Skip to main content

Free CSS Flexbox Generator

Experiment with flex direction, wrap, justify and align on live items — and copy the CSS.

Works offline once loaded
Presets

Tip: click an item in the preview to toggle flex-grow: 1 on it.

Live preview
css
.container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: stretch;
  gap: 12px;
}
html
<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.

  1. 1
    Set the container
    Direction, wrap, justify-content, align-items, gap.
  2. 2
    Add items
    One to ten numbered flex items.
  3. 3
    Experiment
    Click an item to toggle flex-grow and see the effect.
  4. 4
    Copy the CSS
    The container (and item) rules, ready to paste.

Everything runs in your browser — nothing is uploaded.

Related Tools

Frequently Asked Questions