MentorMakers Login Sign up

Do More with MentorMakers

Free tools. Powerful features. Built for a smarter tomorrow.

  • 260 Free Tools
  • Most tools — no signup
  • Temporary files handled for processing
  • AI Assistant built in
  • Made in Pakistan
Explore All Tools

CSS Grid Generator

Set up the grid, drag across cells to add items, then copy the CSS and HTML.

Drag across cells in the grid below (or click a start cell, then an end cell) to add an item. Items show their own CSS.

CSS Grid in short

CSS Grid lays out a page or component in rows and columns at the same time. The container gets display: grid and a track list for columns and rows, and each child can span several cells. It is supported by every current browser.

  • fr is a share of the free space: 1fr 2fr makes the second column twice as wide as the first.
  • repeat(4, 1fr) is short for four equal columns.
  • minmax(0, 1fr) stops long words or wide images from stretching a column.
  • auto sizes a track to its content.
  • gap sets the space between tracks (row gap first, then column gap).

Placing items

The generator writes each item as grid-area: row-start / column-start / row-end / column-end, using grid line numbers. Lines are counted from 1, so an item covering columns 2 to 4 ends on line 5. Items can't overlap here. Children without a grid-area fill the remaining cells in order.

Making it responsive

On small screens, wrap the grid in a media query and switch to one column: @media (max-width: 600px) { .grid { grid-template-columns: 1fr; } .grid > * { grid-area: auto; } }. For a gallery of cards that wraps by itself, use repeat(auto-fill, minmax(200px, 1fr)) as the custom column template.

Free to useNo software to install — works in any modern browser.
No signup neededOpen the tool and start straight away.
Runs in your browserNothing you enter is sent to a server.
Works on mobileSame tool on your phone, tablet or desktop.

Prefer to just describe the task? The AI Assistant can convert, compress and resize files from a short instruction.

Rate this tool

Log in to leave a review.

Processing your file…
Large files, OCR and video can take a minute or two — please keep this page open.
Bookmark this page
Press Ctrl+D for quick access next time