TontonTools

Flexbox Playground

Learn flexbox visually — flip the properties, watch the layout respond.

100% Free No signup Privacy-friendly Web Development
Updated Sep 2026
Share X / Twitter Facebook LinkedIn WhatsApp

How to use Flexbox Playground

  1. Set the item count to roughly match your real layout.
  2. Flip the dropdowns — direction, justify-content, align-items, wrap, gap — and watch the response.
  3. Learn the axis flip: change direction and re-test justify vs align — the core flexbox insight.
  4. Copy the winning combination into your stylesheet's container rule.

What is Flexbox Playground?

A flexbox playground is an interactive sandbox for CSS's main layout system: dropdowns for flex-direction, justify-content, align-items, flex-wrap and gap, a live container of items that rearranges the instant you change one — the cause-and-effect loop that makes flexbox finally click.

Flexbox's notorious learning hurdle is its axis system: justify-content works along the main axis and align-items along the cross axis — but which is which flips when direction changes from row to column. Reading that sentence rarely teaches it; flipping the dropdown and watching does.

About the Flexbox Playground

Set the container properties and watch numbered items obey: direction row or column, justification from flex-start through space-evenly, alignment, wrapping, gap size and item count — every combination visible immediately.

The experiments that teach the most: set direction to row, walk justify-content through all six values, then switch direction to column and walk them again — the axis flip becomes intuitive in one minute; compare space-between, space-around and space-evenly side by side (the difference in edge spacing that documentation diagrams never quite land); and toggle wrap with a dozen items to see how flex handles overflow.

It doubles as a working reference: recreate the layout you're fighting with, find the property combination that fixes it, and transfer the winning values to your CSS. Centering a div — the eternal question — is justify-content: center; align-items: center, verifiable here in two clicks.

Frequently Asked Questions

justify-content distributes along the main axis (horizontal in row direction), align-items along the cross axis (vertical in row). Switch direction to column and they swap orientations — try it here; it's the flexbox rite of passage.
On the container: display:flex; justify-content:center; align-items:center. The historically hard "center a div" is three declarations — verify it live in the playground.
Edge handling: between puts no space at the edges, around gives edges half the inner spacing, evenly makes all gaps equal including edges. Seen side by side once, never confused again.
When items overflow the container: nowrap (default) squeezes or overflows them; wrap flows extras to new lines — the responsive-grid-without-media-queries pattern, especially with gap.
Flexbox for one-dimensional flow (navbars, button rows, card stacks — content sizes the layout); Grid for two-dimensional structure (page scaffolds, aligned rows AND columns — layout sizes the content). Real pages use both, nested.

We use cookies for analytics and to keep the tools free via ads. See our Privacy Policy.