🗀 CSS Layout Generator

Visual Flexbox and Grid layout builder with live preview. Configure properties, add items, and copy production-ready CSS and HTML. Runs in your browser.

Last updated: November 8, 2026 · By the BoltQuickTools team

Presets:

Items

Live Preview

CSS

HTML

Trying flexbox and grid settings without editing a stylesheet

When you cannot remember what align-content does on a wrapping row, or why a grid item will not span, trying values and watching the boxes move is faster than reloading your project. This page does that and writes out the matching CSS and HTML.

Working through a layout

  1. Choose the Flexbox or Grid tab.
  2. Click a button under Presets, or set the container controls yourself, such as flex-wrap or grid-template-columns.
  3. Use + Add Item and - Remove Last to change the number of boxes, up to 12. Each item card has its own settings and a Remove button.
  4. Watch Live Preview, then use Copy above the CSS or HTML box.

Worked example: the Holy Grail preset on the Grid tab

Clicking Holy Grail produces this CSS:

.container {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
}

.item-1 {
  grid-column: 1 / -1;
}

.item-5 {
  grid-column: 1 / -1;
}

and this HTML:

<div class="container">
  <div class="item item-1">1</div>
  <div class="item">2</div>
  <div class="item">3</div>
  <div class="item">4</div>
  <div class="item item-5">5</div>
</div>

Item 1 is the header and item 5 the footer. Each spans from the first to the last column line, with the three middle items falling into the row between them. Defaults are left out, which is why only two items get their own rule.

Differences between the preview and your page

Tabs, shorthand and choosing a system

Why is the Grid tab empty when I first open it?

The three starter boxes are created for Flexbox only. On the Grid tab, click + Add Item or a preset.

Will switching tabs lose my work?

Switching does not, because each tab keeps its own items and settings. Clicking any preset does: it clears the item lists on both tabs, so copy your CSS before trying one.

Does the output use the flex shorthand?

No. You get separate flex-grow, flex-shrink and flex-basis lines, showing only values that differ from the defaults. Combine them yourself if you prefer flex: 1 1 200px.

Should a page layout use flexbox or grid?

Grid suits row-and-column structure such as the page frame, and flexbox suits a single line of things such as a nav bar. The article on CSS layouts goes into that choice in depth. For sizing, the unit converter helps turn pixel tracks into rem, and the CSS units reference lists the options.