An interactive playground for learning and prototyping CSS Flexbox layouts. Toggle every container and item property, see the result instantly, and copy clean CSS or Tailwind code when you are done.
Click an item in the preview to select it and customize its individual flex properties.
.container {
display: flex;
gap: 10px;
}row (default): items flow left to right. column: items flow top to bottom. -reverse variants flip the direction.
Aligns items along the main axis. flex-start: pack to start. center: center items. space-between: equal space between items. space-around: equal space around items. space-evenly: truly equal spacing.
Aligns items along the cross axis. stretch (default): fill the container. center: center on the cross axis. baseline: align text baselines.
nowrap (default): all items on one line, may overflow. wrap: items wrap onto new lines. wrap-reverse: items wrap in reverse order.
Only applies when wrapping is on. Controls how multiple lines are distributed on the cross axis. Works like justify-content but for wrapped lines.
order: controls visual order (lower values come first). flex-grow: how much an item should grow relative to siblings. flex-shrink: how much an item should shrink. flex-basis: initial size before growing/shrinking. align-self: overrides align-items for one item.
CSS Flexbox has a learning curve. Properties like justify-content, align-items, and flex-grow interact in ways that are hard to visualize from documentation alone. A playground removes the guesswork by giving you instant visual feedback. Toggle a property, watch the items move. It takes seconds to understand what would otherwise take minutes of reading and experimenting in a code editor.
This is especially valuable when prototyping. Instead of writing CSS, saving, switching to the browser, checking the result, going back to the editor, and tweaking values, you can build the entire layout visually and copy the finished code. It turns a 15-minute task into a 30-second one.
Centered content. The most common flexbox pattern: display: flex; justify-content: center; align-items: center;. This centers a child both horizontally and vertically within the container. It replaced years of margin-auto hacks and transform tricks.
Navigation bar. A horizontal flex container with justify-content: space-between to push the logo left and nav links right. Or use gap with margin-left: auto on the last group of items.
Equal-height cards. Set display: flex; flex-wrap: wrap; gap: 16px; on the container and flex: 1 1 300px; on each card. Cards grow to fill the row and wrap responsively, always maintaining equal heights within each row.
Sticky footer. Use flex-direction: column; min-height: 100vh; on the page wrapper, then flex-grow: 1 on the main content. The footer stays at the bottom even when content is short.
Last updated: March 2026