KickSolve • Free • Private

CSS Grid Generator

Design CSS grid layouts visually. Choose columns, rows and gaps, set alignment, make items span cells, and copy clean CSS and HTML.

Live grid previewColumn and row spansCopy CSS and HTML
Click a cell to make it span more columns or rows.

Selected item

CSS

HTML

How to use CSS Grid Generator on KickSolve

Three quick steps, no account needed.

Set the gridChoose the number of columns and rows, the gaps and the alignment, or type your own track sizes.
Span the itemsClick an item and make it span more columns or rows.
Copy the codeCopy the CSS and the matching HTML for your project.

Why choose KickSolve

Built for speed, privacy and clean results.

Private by designEverything runs in your browser and nothing is uploaded.
Editable track sizesUse the sliders or type values like 1fr 2fr or minmax().
Clean, minimal codeOnly the item rules you changed are included.
Fast and freeNo sign up and no limits.

What you can do with CSS Grid Generator

Everything this tool offers.

Columns and rowsCreate grids from 1 to 12 columns and rows.
Column and row gapsSet gaps separately or together.
Custom track sizesEdit grid-template-columns and grid-template-rows directly.
Item spansMake any item span several columns or rows.
Alignment controlsSet justify-items and align-items.
Auto flowTry row, column and dense packing.
CSS outputCopy a ready .container rule and item rules.
HTML outputCopy matching markup with numbered items.

About CSS Grid Generator on KickSolve

What it does and how to get the best results.

How the CSS grid generator works

The settings are applied to a live preview container, and the same values are written into the CSS you copy. The Columns and Rows sliders create repeat() tracks with 1fr units, and you can overwrite them with any valid track list. Item spans are added with nth-child selectors, so only the items you changed appear in the code.

Grid terms you should know

A grid container holds the layout. Tracks are its rows and columns, cells are the single spaces between tracks, and gaps are the gutters between them. Items can span several tracks. The fr unit divides the free space, which makes flexible layouts easy to describe.

Useful grid patterns

  • Equal columns: repeat(3, 1fr).
  • Sidebar layout: 250px 1fr.
  • Responsive gallery: repeat(auto-fit, minmax(200px, 1fr)).
  • Holy grail layout: header and footer items spanning all columns.
  • Dashboard tiles: items spanning two columns or two rows.

Alignment in grid

Justify-items aligns items horizontally within their cell and align-items aligns them vertically. The default stretch fills the cell. Use start, center or end to let items keep their natural size inside the cell.

Grid vs flexbox

Grid is two-dimensional, so it controls rows and columns at once and is ideal for page structure. Flexbox is one-dimensional and is ideal for aligning content inside a component. Most real layouts use both.

Good to know

  • The preview container has a fixed height of 320 pixels so row tracks are visible.
  • Invalid track values are ignored by the browser, so the preview keeps the last valid layout.
  • The number of items follows columns times rows, up to 48, and you can change it.

Grid properties at a glance

The properties used by this generator.

PropertyWhat it doesExample
grid-template-columnsDefines the column tracksrepeat(3, 1fr)
grid-template-rowsDefines the row tracksauto 1fr auto
gapSets the space between rows and columns16px 24px
justify-itemsAligns items horizontally in their cellscenter
align-itemsAligns items vertically in their cellsstart
grid-auto-flowControls automatic placement of itemsrow dense
grid-columnMakes an item span columnsspan 2
grid-rowMakes an item span rowsspan 2

Frequently asked questions

Quick answers.

What is CSS grid?

CSS grid is a two-dimensional layout system. You define rows and columns on a container with display: grid and place items into the cells, which makes page and component layouts much simpler than floats or positioning.

What does the fr unit mean?

The fr unit is a share of the free space in the grid container. With grid-template-columns: 1fr 2fr, the second column gets twice as much of the leftover width as the first.

What does repeat(3, 1fr) do?

It is shorthand for three equal columns, the same as writing 1fr 1fr 1fr. Changing the Columns slider rewrites this value for you, and you can also type your own track sizes.

How do I make an item span multiple columns or rows?

Select the item in the preview and set Column span or Row span. The generator adds a grid-column or grid-row rule with span to that item.

What is the difference between justify-items and align-items?

Justify-items aligns items horizontally inside their cells and align-items aligns them vertically. The default value stretch makes items fill the whole cell.

What does grid-auto-flow do?

It controls how items that are not placed explicitly fill the grid. Row fills across first, column fills down first, and the dense option backfills gaps left by larger items.

What is the difference between gap, column-gap and row-gap?

Gap is shorthand that sets the row gap and the column gap together. If both are equal, the generator writes a single value, otherwise it writes the row gap first and then the column gap.

How do I make a responsive grid?

Use repeat(auto-fit, minmax(200px, 1fr)) for the columns. You can type this into the grid-template-columns field to preview a layout that adds and removes columns as the width changes.

Should I use grid or flexbox?

Use grid when you need to control rows and columns together, for example a page layout or a gallery. Use flexbox for one-dimensional layouts such as toolbars and navigation.

Is anything uploaded or stored?

No. The generator runs in your browser and nothing is sent to a server.

More free tools from KickSolve

Related everyday tools.