This tool lets you build Flexbox or CSS Grid layouts from menus instead of memorizing syntax. Switch between Flexbox Box and CSS Grid at the top, set 1 to 12 items with the plus and minus buttons, and pick the properties you want. The live preview applies each change immediately, and the container CSS and matching HTML structure appear below, each with its own copy button. The default output is .container { display: flex; flex-direction: row; justify-content: flex-start; align-items: stretch; flex-wrap: nowrap; gap: 12px; }
Flexbox mode covers flex-direction (row, row-reverse, column, column-reverse), justify-content for the main axis (including space-between, space-around and space-evenly), align-items for the cross axis (including stretch and baseline) and flex-wrap. Remember that the main axis follows the direction: with flex-direction: column, justify-content controls vertical placement and align-items controls horizontal placement. When items are wider than the container, nowrap squeezes them onto one line and only wrap lets them flow onto the next.
Grid mode offers common column templates: equal columns from repeat(2, 1fr) to repeat(4, 1fr), a wider middle column with 1fr 2fr 1fr, and the responsive repeat(auto-fit, minmax(100px, 1fr)), which fits as many columns as the container width allows. Rows can be auto, repeat(2, 80px) or 1fr 1fr. justify-items and align-items position each item horizontally and vertically inside its cell. Both modes share the gap slider (0 to 40px), which spaces columns and rows at once and is cleaner than adding margins to every item.
The generated code contains only the .container layout rules and the .item HTML structure; style the items' colors, size and padding to match your design. A simple rule of thumb: use Flexbox for one-dimensional arrangements such as a row of buttons, a navigation bar or centering a single element, and use Grid for two-dimensional layouts where you need to control rows and columns together, such as card walls or dashboards. Everything updates instantly in your browser, so experiment freely and watch what each property does.