Flexbox Playground
Toggles every flex property on a live example and shows the CSS and what each property changed.
Every flexbox property on a live example, with a line under each control saying what it actually does. The preview is the browser’s own flex layout and the CSS is that state written down, so what you see is what your page will do.
Preview
Click an item to edit its own properties on the right.
Container
Item 1
Code
- · The main axis runs horizontally.
- · Every flex-grow is 0, so justify-content is what divides the spare space.
Properties left at their default are not written out. Only what you changed appears.
How to use it
Set the container properties
Direction, wrapping, and the three alignment properties. Each has a sentence under it explaining what it changes — `align-content` in particular does nothing at all with a single line.
Click an item to edit it
Grow, shrink, basis, align-self and order apply to one item. Add and remove items to see how the container redistributes.
Read the notes and copy the CSS
The panel describes what your current layout will actually do, and the output omits every property still at its default — so what you copy is only what you changed.
Common questions
Why does my item overflow instead of shrinking?
Either `flex-shrink: 0`, or a child with a minimum content size. A flex item’s `min-width` defaults to `auto`, which means it will not shrink below its content — a long unbroken string or a wide image is the usual culprit. `min-width: 0` is the fix.
What is the difference between `align-items` and `align-content`?
`align-items` places each item on the cross axis. `align-content` places the *block of lines* when wrapping has produced more than one — so with `nowrap`, or with a single line, it does nothing whatsoever. That is the most common source of "this property is broken".
Should I use `order` to rearrange things?
Sparingly. It changes the visual order and not the DOM order, so screen readers and tab order still follow the markup. A keyboard user tabbing through a visually reordered layout jumps around the screen — which is why the spec calls it a last resort.
Flexbox or grid?
Flexbox for one dimension — a row of buttons, a toolbar, a card’s internals. Grid when rows and columns have to line up with each other. If you are nesting flex containers to fake a grid, you want a grid.
Feed it from
Next
These accept what this tool produces, so the result can go straight in.
Fluid Size Calculator
Computes a clamp() expression that scales a size smoothly between two viewport widths.
CSS Beautifier & Minifier
Formats or minifies CSS without reordering anything, preserving the token stream exactly.
CSS Grid Builder
Lays out a grid visually with named areas and emits the grid-template CSS.
Colour Format Converter
Converts a colour between HEX, RGB, HSL, HWB, LAB, LCH and OKLCH and names the nearest known colour.
Colour Picker
Picks a colour on an OKLCH field, with a screen eyedropper or from an uploaded image, and copies it in any notation.
Contrast Checker
Scores a foreground and background pair against WCAG 2 and APCA and suggests the nearest passing colour.