Flexbox Playground
Understand flexbox by changing properties and watching the items move.
Runs in your browser. Nothing is uploaded Free, no sign-up Works on mobile
Click an item to toggle flex-grow: 1.
.container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
align-items: stretch;
gap: 12px;
}flex-direction
flex-wrap
justify-content
align-items
align-content (when wrapping)
gap: 12px
Number of items
How to use Flexbox Playground
- Change the container properties.
- Click items to toggle flex-grow.
- Copy the generated CSS.
Frequently asked questions
What is the difference between justify-content and align-items?
justify-content positions items along the main axis (horizontal in a row), align-items along the cross axis (vertical in a row).
Flexbox or grid?
Use flexbox for one-dimensional layouts such as nav bars and button rows, and grid for two-dimensional layouts such as card galleries.
Related tools
All Developer Tools →- CSS Grid Generator Create grid layouts visually, including responsive card grids that need no media queries.
- Box Shadow Generator Build soft, realistic shadows by layering several box-shadows, as modern UI kits do.
- JSONPath Tester Write and debug JSONPath queries used in API tests, Postman, Kubernetes and data pipelines.
- User Agent Parser Find out which browser, OS and device a user agent string belongs to, for debugging and analytics.
- HTTP Status Codes Look up what an HTTP status code means and what usually causes it.
- Chmod Calculator Work out the right chmod value for files and folders on Linux servers.