CSS Grid Generator — Visual Layout Builder
This CSS Grid generator lets you design grid layouts visually and export production-ready CSS. Configure columns, rows, gaps, and item placement in real time — the live preview reflects every change instantly.
How to Use
- Choose a preset — start with Holy Grail, Sidebar, 12-Column, or Card Grid
- Edit columns — click any column size to change it, use the + button to add more, or type
repeat(3, 1fr)orminmax(200px, 1fr)directly - Edit rows — same controls for row track sizes
- Adjust gaps — set column-gap and row-gap independently in pixels
- Select an item — click a box in the preview to configure its column/row position and span
- Name a grid area — optionally assign a semantic area name for use with
grid-area - Copy the CSS — grab just the container block or everything at once
Understanding CSS Grid Properties
Container properties define the grid structure:
grid-template-columns— defines how many columns exist and their sizes. Values:px,fr,auto,%,minmax(),repeat()grid-template-rows— defines row track sizes. Same syntax as columnscolumn-gap/row-gap— space between column and row tracks respectivelyjustify-items— default alignment of items along the inline (row) axis:stretch,start,end,centeralign-items— default alignment along the block (column) axis
Item properties control placement and spanning:
grid-column: start / span N— places the item starting at a column line and spanning N columnsgrid-row: start / span N— places the item starting at a row line and spanning N rowsgrid-area— assigns the item to a named grid area defined on the container
Key Syntax Helpers
repeat(3, 1fr)— three equal columns (shorthand for1fr 1fr 1fr)minmax(200px, 1fr)— column that is at least 200px but grows to fill spacerepeat(3, minmax(200px, 1fr))— responsive card grid: three columns, each 200px minimumauto— size determined by content
Privacy
All layout calculations and CSS generation run entirely in your browser. No data is sent to any server.