Standard

CSS Grid Generator

Set columns, rows and gap visually, then copy the container CSS.

Advertisement

About this tool

Generates equal-width columns and equal-height rows via repeat() — for uneven track sizes, adjust the generated grid-template-columns/-rows by hand.

Tick “responsive” for the popular no-media-query layout: repeat(auto-fit, minmax(min(160px, 100%), 1fr)) fits as many columns as will fit at your minimum width, so a card grid goes from four columns on a desktop to one on a phone automatically. The min(…, 100%) part stops cards overflowing on screens narrower than the minimum. Resize your browser to watch the preview reflow.