Container Properties
flex-direction
justify-content
align-items
flex-wrap
align-content
gap (px)
Item Properties
Count
flex-grow
flex-shrink
flex-basis px
Generated CSS
What This Tool Does
Visualise CSS Flexbox layout properties interactively. Adjust all container properties (flex-direction, justify-content, align-items, flex-wrap, align-content, gap) and item properties (flex-grow, flex-shrink, flex-basis, count) with live preview. The generated CSS updates instantly.
Frequently Asked Questions
What is Flexbox?
CSS Flexbox (Flexible Box Layout) is a one-dimensional layout model that distributes space and aligns items in a container along a main axis (row or column). It is ideal for navigation bars, card rows, centering elements, and any single-direction layout.
What is the difference between justify-content and align-items?
justify-content controls alignment along the main axis (horizontal in row, vertical in column). align-items controls alignment along the cross axis (perpendicular to the main axis). Think of justify as the primary direction and align as the secondary direction.
When should I use Flexbox vs Grid?
Use Flexbox for one-dimensional layouts — rows OR columns. Use Grid for two-dimensional layouts where you need control over both rows and columns simultaneously. In practice, many layouts combine both: Grid for page structure, Flexbox for component internals.