Free online tools

CSS Grid Generator

Build an equal-column CSS Grid or a responsive card grid that wraps as space changes. Set the gaps, preview the tracks and copy the CSS.

Enter your values

Used with fixed columns.

Used in auto-fit and auto-fill modes.

This tool processes your input in your browser.

Result

Choose a fixed or responsive layout

Fixed columns stay in the same count at every width. Responsive modes add tracks when space is available and wrap when the card minimum would no longer fit. The generated minimum uses min(100%, width) so a narrow container can still show one track.

Pick auto-fit or auto-fill

Auto-fit collapses empty tracks so existing items can expand. Auto-fill reserves empty tracks as long as there is room for them. The difference is visible when there are fewer items than tracks.

Frequently asked questions

What does 1fr mean?

It gives a track a share of the available space. In the generated equal grid, equally flexible tracks share what remains after gaps and minimums.

Where should I place my cards?

Apply the CSS rule to a container and put the card elements inside it. The grid layout applies to the direct children. The preview displays six sample items, so your final layout can fit a different number.