T
THINKFORU
Submit Feedback

CSS Grid Layout Builder: Visual Grid Generator

CSS Grid Layout Builder: Visual Grid Generator

CSS Grid Layout Builder

Save on Google

Free online CSS Grid generator. Set the columns, rows, gaps and alignment, place and span items, preview the grid live and click any item to edit it, then copy the CSS, HTML or Tailwind classes. Everything runs in your browser. Nothing is stored or uploaded.

Inputs

Quick presets

Grid container

Alignment and flow

Grid items

Click an item in the preview, or pick it below. Set Start to auto to let the browser place it.

Edit item 1

Output

Live preview

CSS output



HTML output



Tailwind CSS markup



Share this grid

This link opens the builder with your exact grid. It updates every time you change something.

https://www.thinkforu.org/p/css-grid-creator-create-beautiful-grid.html

Share with developers

Related tools

ToolWhat it does
PX to REM / EM ConverterConvert pixel values to rem and em.
CSS Glassmorphism GeneratorFrosted-glass blur and transparency effects.
CSS Neumorphism (Soft UI) GeneratorSoft extruded shadows for UI elements.
CSS Box Shadow & Glow StackerLayer multiple shadows and glows.
CSS Mesh & Multi-Gradient GeneratorBuild mesh and multi-stop gradients.
CSS Grid Layout BuilderDesign grids visually and copy the CSS.
CSS clamp() CalculatorFluid typography and spacing values with clamp().

44 CSS Grid layout presets

Equal columns, sidebar and page layouts, bento grids, galleries, responsive card grids, dashboards, forms and a calendar. Search by name, filter by type, then click Apply to load a layout into the builder above, or Copy CSS to use it as it is.


Showing 44 of 44 presets

NameTypePreviewSettingsActions
3-Column CardsEqual columnscolumns: repeat(3, 1fr); rows: repeat(2, 1fr); 6 items
1-Column GridEqual columnscolumns: repeat(1, 1fr); rows: repeat(2, 1fr); 2 items
2-Column GridEqual columnscolumns: repeat(2, 1fr); rows: repeat(2, 1fr); 4 items
4-Column GridEqual columnscolumns: repeat(4, 1fr); rows: repeat(2, 1fr); 8 items
5-Column GridEqual columnscolumns: repeat(5, 1fr); rows: repeat(2, 1fr); 10 items
6-Column GridEqual columnscolumns: repeat(6, 1fr); rows: repeat(2, 1fr); 12 items
8-Column GridEqual columnscolumns: repeat(8, 1fr); rows: repeat(2, 1fr); 16 items
10-Column GridEqual columnscolumns: repeat(10, 1fr); rows: repeat(2, 1fr); 20 items
12-Column GridEqual columnscolumns: repeat(12, 1fr); rows: repeat(2, 1fr); 24 items
Left SidebarSidebarcolumns: 250px 1fr; rows: repeat(1, 1fr); 2 items
Right SidebarSidebarcolumns: 1fr 250px; rows: repeat(1, 1fr); 2 items
Two SidebarsSidebarcolumns: 200px 1fr 200px; rows: repeat(1, 1fr); 3 items
Narrow Left RailSidebarcolumns: 80px 1fr; rows: repeat(1, 1fr); 2 items
Sidebar 1 to 3Sidebarcolumns: 1fr 3fr; rows: repeat(1, 1fr); 2 items
Content and Aside 2 to 1Sidebarcolumns: 2fr 1fr; rows: repeat(1, 1fr); 2 items
Sidebar with HeaderSidebarcolumns: 250px 1fr; rows: 80px 1fr; 3 items
Sidebar Header FooterSidebarcolumns: 250px 1fr; rows: 80px 1fr 60px; 4 items
Holy Grail LayoutPage layoutcolumns: 200px 1fr 200px; rows: 80px 1fr 60px; 5 items
Header Content FooterPage layoutcolumns: repeat(1, 1fr); rows: 80px 1fr 60px; 3 items
Centered Content ColumnPage layoutcolumns: 1fr minmax(0, 720px) 1fr; rows: repeat(1, 1fr); 1 item
Hero and FeaturesPage layoutcolumns: repeat(3, 1fr); rows: 2fr 1fr; 4 items
Feature Row 1 and 2Page layoutcolumns: repeat(3, 1fr); rows: repeat(2, 1fr); 4 items
Bento 4x3 ClassicBentocolumns: repeat(4, 1fr); rows: repeat(3, 1fr); 6 items
Bento 3x3Bentocolumns: repeat(3, 1fr); rows: repeat(3, 1fr); 5 items
Bento Hero LeftBentocolumns: repeat(3, 1fr); rows: repeat(2, 1fr); 3 items
Bento Wide TopBentocolumns: repeat(4, 1fr); rows: repeat(2, 1fr); 4 items
Bento Tall LeftBentocolumns: repeat(3, 1fr); rows: repeat(2, 1fr); 4 items
Bento Dashboard TilesBentocolumns: repeat(4, 1fr); rows: repeat(4, 1fr); 5 items
Gallery 4x2 One WideGallerycolumns: repeat(4, 1fr); rows: repeat(2, 1fr); 7 items
Gallery 3x3 FeaturedGallerycolumns: repeat(3, 1fr); rows: repeat(3, 1fr); 6 items
Gallery Tall and WideGallerycolumns: repeat(4, 1fr); rows: repeat(3, 1fr); 10 items
Auto-fit Cards 160pxAuto-fit cardscolumns: repeat(auto-fit, minmax(160px, 1fr)); rows: auto; 6 items
Auto-fit Cards 200pxAuto-fit cardscolumns: repeat(auto-fit, minmax(200px, 1fr)); rows: auto; 6 items
Auto-fit Cards 240pxAuto-fit cardscolumns: repeat(auto-fit, minmax(240px, 1fr)); rows: auto; 6 items
Auto-fit Cards 280pxAuto-fit cardscolumns: repeat(auto-fit, minmax(280px, 1fr)); rows: auto; 6 items
Auto-fit Cards 320pxAuto-fit cardscolumns: repeat(auto-fit, minmax(320px, 1fr)); rows: auto; 6 items
Auto-fill Cards 240pxAuto-fit cardscolumns: repeat(auto-fill, minmax(240px, 1fr)); rows: auto; 6 items
Dashboard 12 ColumnDashboardcolumns: repeat(12, 1fr); rows: 80px 120px 1fr 1fr; 7 items
Analytics 3x3Dashboardcolumns: repeat(3, 1fr); rows: repeat(3, 1fr); 4 items
Admin LayoutDashboardcolumns: 240px 1fr; rows: 64px 1fr; 3 items
Kanban 4 ColumnsDashboardcolumns: repeat(4, 1fr); rows: repeat(1, 1fr); 4 items
Label and Input FormFormcolumns: max-content 1fr; rows: auto; 8 items
Two Column FormFormcolumns: repeat(2, 1fr); rows: auto; 5 items
Calendar 7x5Calendarcolumns: repeat(7, 1fr); rows: repeat(5, 1fr); 35 items

What is CSS Grid?

CSS Grid is a layout system that places items in rows and columns at the same time. You turn an element into a grid with display: grid, describe its tracks with grid-template-columns and grid-template-rows, add space with gap, and position children by line numbers or spans such as grid-column: 1 / span 2.

This CSS Grid layout builder lets you do all of that visually. Choose the number of columns and rows or type your own track sizes (for example 250px 1fr or repeat(auto-fit, minmax(240px, 1fr))), click items to span them across tracks, test the alignment properties, and copy the finished CSS, HTML or Tailwind markup. It is a good fit for page layouts, dashboards, galleries and bento grids.

How to use this CSS Grid builder

  1. Start with a quick preset, or pick any layout from the presets table with Apply.
  2. Set the number of columns and rows, the gaps and the container height, or type your own track sizes.
  3. Choose alignment and auto-flow options to see how items and tracks move.
  4. Click an item in the preview, then set its Column start, Column span, Row start and Row span. Add or remove items as needed.
  5. Press Copy CSS, Copy HTML or Copy Tailwind markup, or use Open Link and the share buttons to send the exact grid to a teammate.

CSS Grid guide: tracks, responsive grids, placement and accessibility

#TopicWhat to knowWhat to do
1fr, px and auto tracksfr shares the free space, px is fixed, and auto sizes to the content. Mixing them is how you build a fixed sidebar next to a flexible main area.Use something like 250px 1fr for a sidebar layout, and 1fr units for evenly flexible columns.
2Responsive grids without media queriesrepeat(auto-fit, minmax(240px, 1fr)) creates as many columns as fit and stretches them to fill the row.Use auto-fit for card grids. Use auto-fill if you want empty column slots to stay reserved.
3gap, not marginsgap adds space between tracks only, so there is no extra margin on the outer edges.Set row and column gaps with the sliders, or use one gap value for both.
4Implicit tracksItems placed outside the defined rows or columns create extra implicit tracks sized by grid-auto-rows and grid-auto-columns.Define enough rows and columns, or set grid-auto-rows when the number of items can grow.
5Placement and spanninggrid-column and grid-row place an item with a start line and a span, for example 1 / span 2. Items can overlap if their areas intersect.Use Column start and Column span on an item, and leave start at auto to let the browser place it.
6justify vs alignjustify-items and align-items position items inside their own cell. justify-content and align-content position the whole grid inside the container when the tracks are smaller than it.Use the Alignment selects to test each property and see the difference live.
7Accessibility and reading orderGrid can move items visually without changing the HTML order, but keyboard focus and screen readers follow the HTML order.Keep the source order logical and avoid large visual reordering of interactive content.

Frequently asked questions

#QuestionAnswer
1What is CSS Grid and how do I create a grid layout?CSS Grid is a two-dimensional layout system that arranges items in rows and columns. Set display: grid on a container, define columns with grid-template-columns, optionally define rows with grid-template-rows, and add a gap. This CSS grid generator builds those rules for you and shows the result live.
2What does grid-template-columns: repeat(3, 1fr) mean?It creates three equal-width columns. The fr unit is a fraction of the free space in the container, and repeat(3, 1fr) is shorthand for 1fr 1fr 1fr. You can mix units, for example 200px 1fr 2fr for a fixed column followed by two flexible columns where the last one is twice as wide.
3What is the difference between auto-fit and auto-fill?Both create as many columns as fit, such as repeat(auto-fit, minmax(240px, 1fr)). With auto-fill, empty tracks keep their space when there are few items. With auto-fit, empty tracks collapse so the existing items stretch to fill the row.
4How do I make an item span multiple columns or rows?Use grid-column and grid-row with the span keyword, for example grid-column: 1 / span 2 to start at line 1 and span two columns, or grid-row: span 2. In this builder, select an item and use the Column start, Column span, Row start and Row span sliders.
5What is the difference between gap, row-gap and column-gap?gap is the shorthand for row-gap and column-gap. gap: 16px sets both, and gap: 24px 16px sets row gap 24px and column gap 16px. Gaps only appear between tracks, not around the outside of the grid.
6When should I use CSS Grid instead of Flexbox?Use Grid when you need to control rows and columns together, such as page layouts, dashboards, galleries and bento grids. Use Flexbox for one-dimensional rows or columns, such as navigation bars and button groups. They work well together.
7How do I use CSS Grid in Tailwind CSS?Use grid with grid-cols-3, grid-rows-2 and gap-4, and place items with col-span-2, row-span-2, col-start-2 and similar classes. For custom tracks use arbitrary values such as grid-cols-[200px_1fr]. The Tailwind output box generates the markup with these classes.