CSS Flexbox Playground

Visually explore CSS Flexbox properties with a live preview. Adjust container and item properties, then copy the generated CSS.

Container Properties

Click an item in the preview to edit its individual properties.
6 items
Ad space - AdSense banner will appear here

About CSS Flexbox

Flexbox (Flexible Box Layout) is a CSS layout model designed for building responsive, dynamic layouts. It distributes space among items in a container, even when their sizes are unknown.

Key Concepts

FAQ

Flexbox vs Grid — when to use which?

Use Flexbox for one-dimensional layouts (a row or a column of items). Use CSS Grid for two-dimensional layouts (rows AND columns). Flexbox is great for navbars, card rows, and centering. Grid is better for page layouts and complex grids.

What does flex: 1 mean?

flex: 1 is shorthand for flex-grow: 1; flex-shrink: 1; flex-basis: 0%. It means the item will grow to fill available space equally with other flex: 1 items.