不喜欢广告? 无广告 今天

CSS 网格生成器 (可视化)

开发人员文本
广告 · 消除?

Grid Settings

Space-separated values (e.g., 1fr 1fr 1fr, 200px 1fr 2fr)
Space-separated values (e.g., auto 1fr auto)

Preset Layouts


Grid Editor

Click a cell to assign an area name. Cells with the same name share a color.

广告 · 消除?

指导

CSS Grid Generator (Visual)

CSS Grid Generator

Build CSS Grid layouts visually. Click cells to define named areas, adjust column and row sizes, and get production-ready CSS code instantly. No memorizing grid syntax — just click and build.

如何使用

Set the number of columns and rows, then click on grid cells to assign named areas (like header, sidebar, main, footer). Cells with the same name are highlighted in the same color. The CSS output updates live as you design your layout. Use preset buttons for common layouts like Holy Grail or Dashboard.

特征

  • Interactive Grid Editor – Click cells to assign named areas with auto-colored visualization
  • Live CSS Output – Production-ready code with grid-template-areas, grid-template-columns, grid-template-rows, and gap
  • 实时预览 – See your layout rendered with colored named areas in real time
  • Preset Layouts – One-click Holy Grail, Dashboard, Blog, and Portfolio layouts
  • Flexible Sizing – Define column and row sizes using fr, px, or percentage units
  • Child Element CSS – Generates grid-area rules for each named area automatically
  • 100% 客户端 – All layout generation happens in your browser

广告 · 消除?

常问问题

  1. What is CSS Grid and how is it different from Flexbox?

    CSS Grid is a two-dimensional layout system that handles both columns and rows simultaneously. Flexbox is one-dimensional, working along either a row or a column axis. Grid is ideal for page-level layouts (headers, sidebars, content areas), while Flexbox excels at component-level alignment (navigation items, card contents). Most modern layouts use both together.

  2. What is the fr unit in CSS Grid?

    The fr (fraction) unit represents a fraction of the available space in the grid container. 1fr 2fr means the second column gets twice the space of the first. It is similar to flex-grow in Flexbox but designed specifically for grid tracks. fr units automatically distribute remaining space after fixed-size tracks (px, em) are allocated.

  3. What is grid-template-areas and why use named areas?

    grid-template-areas lets you define your layout using named strings that visually represent the grid structure in your CSS. Instead of placing items by line numbers (grid-column: 1 / 3), you assign them by name (grid-area: header). The resulting CSS reads like an ASCII art version of your layout, making it self-documenting and easier to maintain.

  4. What is the Holy Grail layout in web design?

    The Holy Grail layout is a classic web page structure with a header spanning the full width, a three-column body (left sidebar, main content, right sidebar), and a full-width footer. It was historically difficult to achieve with CSS floats and was called the Holy Grail because a clean implementation was so elusive. CSS Grid makes it trivial.

想要享受无广告的体验吗? 立即无广告

安装我们的扩展

将 IO 工具添加到您最喜欢的浏览器,以便即时访问和更快地搜索

添加 Chrome 扩展程序 添加 边缘延伸 添加 Firefox 扩展 添加 Opera 扩展

记分板已到达!

记分板 是一种有趣的跟踪您游戏的方式,所有数据都存储在您的浏览器中。更多功能即将推出!

广告 · 消除?
广告 · 消除?
广告 · 消除?

新闻角 包含技术亮点

参与其中

帮助我们继续提供有价值的免费工具

给我买杯咖啡
广告 · 消除?