Flexbox Playground
Try every flex container and item property on a live preview, then copy the CSS and HTML.
🔒 Runs in your browser — files never leave your deviceFree · No sign-up
Preview — click an item to edit it
Container
Presets
Selected item
CSS
HTML
How to use the Flexbox playground
- Set the container properties — direction, wrapping, and the two alignment axes — and watch the preview react.
- Click any item in the preview to give it its own grow, shrink, basis, order or align-self.
- Copy the CSS and the matching HTML when the layout looks right.
FAQ
What is the difference between justify-content and align-items?
justify-content works along the main axis (horizontal when flex-direction: row), align-items along the cross axis. Switching to column swaps which visual direction each one controls.
When does align-content do anything?
Only when items wrap onto more than one line and the container is taller than those lines need. With flex-wrap: nowrap it has no effect at all.
What should flex-basis be?
auto uses the item's own width or height; a length such as 200px sets a starting size before grow and shrink are applied; 0 makes grow share the whole container so items end up in exact proportions.