Build CSS Flexbox and Grid layouts visually with live preview. Control container and item properties, then copy the ready-to-use CSS.
display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: stretch; gap: 8px;
/* all items use defaults */
CSS Flexbox and Grid are the two main layout systems in modern CSS. Flexbox handles one-dimensional layouts - rows or columns - and is ideal for navigation bars, toolbars, and component alignment. CSS Grid handles two-dimensional layouts with rows and columns simultaneously, making it the right tool for page layouts, card grids, and complex UI structures. Both systems use a container/item model: properties on the container define the overall layout, while properties on individual items control how they fit within it.
Switch between Flexbox and Grid modes using the tabs at the top. Adjust the container properties to set the overall layout direction, wrapping, alignment, and gaps. Select an item by clicking its numbered chip or clicking directly in the preview, then configure its individual properties. The preview updates live as values change. Copy the Container CSS and Item CSS blocks and paste them into your stylesheet.
The item CSS output groups overrides by item class (.item-1, .item-2, etc.). Items that use only the container defaults produce no output - only overridden items are listed. For Grid mode, column and row span values use the span N shorthand. The repeat() template is written as repeat(N, Xunit) for equal-width tracks. Adjust the unit selector between fr, px, and % to match your layout needs.