🗀 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
Items
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
- Choose the Flexbox or Grid tab.
- Click a button under Presets, or set the container controls yourself, such as flex-wrap or grid-template-columns.
- 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.
- 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
- The preview has a minimum height of 320px, and the output does not. The Flexbox Centered preset centers vertically in the preview, but its CSS sets no height. In your page the container will be only as tall as its content until you add one.
- The grid has no breakpoints. Fixed tracks like
200px 1fr 200pxstay as written on a phone. Add your own media query. - The Flexbox Holy Grail is only five stacked boxes. One flex container cannot make the three-column middle row. Use the Grid version.
- Show grid lines draws a fixed 20px graph-paper background. It does not mark your actual tracks.
- Text fields are not checked. A typo in grid-template-columns or flex-basis goes straight into the output, and the preview just ignores it. Text fields apply when you press Enter or click away.
- Clearing a number box writes broken CSS. An empty gap (px) gives
gap: px;. .itemgets no styles..item-Nfollows position, so removing item 2 renumbers the rest.
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.