✅ CSS code copied

📐 Grid Layout Generator

Visual grid design · custom columns/rows · responsive breakpoints · named areas · 6 presets

📏

Grid structure

1 3 12
1 3 12
🎯

Gap & alignment

0px 15px 50px
0px 15px 50px
📱

Responsive breakpoints

📱 Phone
📟 Tablet
💻 Laptop
🖥️ Desktop
🏷️

Named grid areas (grid‑area)

Name each cell – identical names merge into one area

📝 CSS (production‑ready)

/* Grid CSS will appear here */

🎨 Preset layouts – click to load

📊
Basic
📐
Sidebar
🃏
Cards
📈
Dashboard
🖼️
Gallery
✝️
Holy Grail

📖 Online Grid Layout Generator: From Beginner to Production

CSS Grid is a two‑dimensional layout system that handles rows and columns simultaneously – the ultimate tool for complex page structures. The ng.cc online Grid generator lets you visually control column/row counts, gaps, alignment, named areas, and responsive breakpoints. Live preview updates instantly, and you can copy production‑ready CSS with one click. No need to memorise grid‑template‑columns or other complex syntax.

📏 Full grid structure control

Adjust 1‑12 columns/rows freely. Column/row definitions support all units: fr, px, %, auto, minmax(). Any combination possible.

🏷️ Visual named areas

Use grid‑template‑areas by naming each cell; identical names merge automatically – perfect for holy grail or sidebar layouts.

📱 Responsive breakpoint design

4 preset breakpoints included, and you can add custom ones. Switch device sizes in preview and the @media code updates.

🎨 6 production‑ready presets

Basic, sidebar, card grid, dashboard, gallery, holy grail – one click to load and then tweak as needed.

🎯 Grid vs Flexbox: which one to use?

💡 Grid core properties quick guide

🔹 Container properties

Property Example Description
grid‑template‑columns1fr 2fr 1frDefines column widths; fr = fraction of free space
grid‑template‑rows100px auto 80pxDefines row heights
grid‑template‑areas"header header"
"sidebar main"
"footer footer"
Names grid areas for placement
gap20px 15pxRow and column gaps
justify‑itemscenter | start | end | stretchHorizontal alignment inside cells
align‑itemscenter | start | end | stretchVertical alignment inside cells

🔹 The fr unit explained

fr stands for “fraction” of the available space. For example 1fr 2fr means the second column is twice as wide as the first. You can mix with fixed units: 200px 1fr 1fr – first column fixed, remaining space split equally between the other two.

🎨 6 preset layouts in detail

❓ Frequently Asked Questions

Q1: How do I use minmax()?
minmax(min, max) sets a size range. Example: minmax(100px, 1fr) means at least 100px, then expands. minmax(200px, 300px) keeps it between fixed limits. You can type it directly into the column/row input boxes.
Q2: What’s the point of named grid areas?
With grid‑template‑areas and grid‑area you place items by name rather than line numbers. For example, giving several cells the name “header” merges them into one region – the most elegant way to create holy grail or complex dashboards.
Q3: Why aren’t my responsive breakpoints working in the preview?
The tool generates standard @media queries; you need to copy the CSS into your project. For preview, switching device sizes simulates different widths, but the current implementation forces a single column for simplicity. You can edit the generated CSS to fine‑tune.
Q4: Can I use repeat()?
Yes, simply type repeat(3, 1fr) directly into the column/row inputs. The tool passes it unchanged to the CSS.
Q5: How do I make an item span multiple rows/columns?
Two ways: 1) Use grid‑column: span 2 etc. on the item (you would need to add that manually), or 2) use named areas – assign the same name to several cells, and that item will cover them all. This tool focuses on the second method.
Q6: Is the generated CSS cross‑browser?
CSS Grid is a W3C standard, fully supported in all modern browsers (Chrome 57+, Firefox 52+, Safari 10.1+, Edge 16+). Coverage is over 95%. Internet Explorer 11 supports an older version with -ms‑ prefixes; our code works for 99% of production environments.

🔗 Related Tools

This tool is part of the ng.cc design toolkit. You might also need:

⚡ All tools run locally in your browser – no data ever uploaded. Safe for commercial projects.