CSS Grid Generator — Visual Layout Builder with Live Preview
Interactive CSS Grid playground. Configure grid-template-columns / rows with fr / px / auto tracks, gap, and per-item span. Live preview + copy-ready CSS and Tailwind classes. 100% local.
Last updated:
Comments.container {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 80px 80px;
column-gap: 12px;
row-gap: 12px;
}grid grid-cols-3 grid-rows-[80px_80px] gap-3
Frequently Asked Questions
What is the fr unit?
fr stands for 'fraction of the free space'. When you write grid-template-columns: 1fr 2fr, the second column gets twice as much of the remaining space as the first (after any fixed-size tracks are laid out). Unlike percentages, fr accounts for gaps automatically. It's the go-to unit for flexible grid layouts.
When should I use grid instead of flexbox?
Grid is a two-dimensional layout system: you define rows and columns simultaneously and can place items into cells. Flexbox is one-dimensional. Use grid for anything that has a real 2D structure — dashboards, card galleries, magazine layouts, whole-page templates. Use flexbox for aligning a row or column of items.
How do I make an item span multiple columns or rows?
Set grid-column: span 2 (or span N) to make an item take N columns starting from the auto-placed position. To place it at a specific column, use grid-column: 2 / span 2 (start at line 2, span 2 tracks). Same syntax for grid-row. This tool exposes those directly in the item panel.
What are min-content and max-content?
min-content sizes the track to the largest unbreakable chunk of content inside it (usually the longest word). max-content sizes it to the widest the content wants to be if it never wrapped. Useful for text-driven columns where you don't want awkward mid-word breaks or unnecessarily wide columns.
Are the generated Tailwind classes production-ready?
Yes. When you use equal 1fr columns, the tool emits shortcuts like grid-cols-3. Custom track sizes fall back to arbitrary-value syntax like grid-cols-[200px_1fr_100px]. Both forms are valid Tailwind v3+ classes.
Related Tools
cURL Converter
Convert cURL commands to Python (requests), JavaScript (fetch), Node.js, Go (net/http), PHP, or Java (HttpClient). Parses -H, -d, --data-urlencode, -F, -u, --json and more. 100% local.
URL Parser
Parse any URL into scheme, host, port, path, and query parameters — or build a URL from scratch with a form. Great for debugging redirect chains, tracking pixels, and OAuth flows. 100% local.
CIDR Calculator
Calculate IPv4 subnets from CIDR notation online. Get network address, broadcast, netmask, wildcard, usable host range, IP class, and binary representation. 100% local — nothing leaves your browser.
Color Converter
Convert colors between HEX, RGB, HSL, and HSV instantly. Includes a live color preview and copy-ready CSS strings.
Meta Tag Preview
Preview how your page will appear in Google search results and social share cards on Facebook, Twitter/X, and LinkedIn. Parses <title>, meta description, canonical, and full Open Graph / Twitter Card tags with diagnostics. 100% local.
HTML Minifier
Minify HTML by removing comments, collapsing whitespace, and stripping optional attribute quotes and void-element slashes. Reports byte savings. Preserves IE conditional comments and preformatted <pre> / <textarea> / <script> / <style> content. 100% local.