Header
Preview color is tied to this item for easy visual tracking.
A CSS flexbox playground is an interactive tool that lets you adjust container and item properties and see the layout update instantly. Use this free CSS flexbox tester to learn how direction, alignment, wrapping, and sizing work without guessing in a larger project.
Want more than a flexbox layout tool? Explore the full Zap Code builder to turn layouts into real apps and games.
What this tool includes
Full container controls
Adjust direction, wrapping, alignment, and spacing in one panel.
Per-item Flexbox rules
Test flex-grow, flex-shrink, flex-basis, align-self, and order on every item.
Ready-made layout presets
Compare centered, sidebar, holy grail, navbar, and card grid patterns instantly.
Start from a real layout preset or dial in every property manually. The preview and generated CSS stay in sync while you experiment.
Preset Layouts
Each preset starts with sensible flex values so you can compare practical layout structures before making them your own.
Container Properties
The container controls the main axis, cross axis, wrapping behavior, and spacing between items.
align-content becomes visible when items wrap into multiple lines.
Flex Items
Flexbox becomes clearer when you compare how each item grows, shrinks, reorders, or overrides the container alignment.
Header
Preview color is tied to this item for easy visual tracking.
Nav
Preview color is tied to this item for easy visual tracking.
Main
Preview color is tied to this item for easy visual tracking.
Aside
Preview color is tied to this item for easy visual tracking.
Footer
Preview color is tied to this item for easy visual tracking.
Start with centered, sidebar, holy grail, navbar, or card grid to see a real pattern before you edit individual properties.
Change flex-direction, justify-content, align-items, align-content, flex-wrap, and gap to understand how the container controls the whole layout.
Edit flex-grow, flex-shrink, flex-basis, align-self, and order on each item to see how item-level rules reshape the final result.
Use the copy button to grab the live CSS output and paste it directly into your project, prototype, or lesson notes.
Common questions about alignment, wrapping, item sizing, and when to choose Flexbox over Grid.
A CSS flexbox playground is an interactive tool that lets you change flex container and flex item properties and see the layout update instantly. It is useful for learning how Flexbox works because direction, alignment, wrapping, and sizing all respond in real time.
justify-content controls how flex items are distributed along the main axis. In a row layout that means horizontal spacing, and in a column layout it means vertical spacing. Values like center, space-between, and space-evenly make it easy to compare layout behaviors quickly.
align-items controls how items sit on the cross axis within a single line, while align-content controls how multiple wrapped lines are spaced inside the container. If flex-wrap is set to nowrap, align-content usually will not create a visible change.
flex-basis sets the starting size, flex-grow decides how extra space is shared, and flex-shrink decides how items compress when there is not enough room. Testing these three values side by side is one of the fastest ways to understand real Flexbox sizing behavior.
Use Flexbox when you are aligning items in one dimension, such as a row of buttons, a centered hero block, or a responsive navbar. Use CSS Grid when you need precise two-dimensional control over rows and columns at the same time.
Practice layout, color, and animation skills together, then head back to Zap Code to build a full project.
Pair layout practice with motion by testing keyframes, transitions, and timing functions live.
Open toolChoose color palettes, copy HEX, RGB, or HSL values, and tighten the visual side of your next layout.
Open toolPractice HTML, CSS, and JavaScript basics with instant feedback and age-friendly explanations.
Open tool