<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-create-a-3x3-grid-layout-with-css-grid-sg1ixre5u" -->

---
title: How to Create a 3x3 Grid Layout with CSS Grid | daily.dev
description: A 3x3 grid needs a parent div with nine child divs and four CSS lines: display: grid, gap: 10px, and grid-template-columns and grid-template-rows set to...
canonical: https://daily.dev/posts/how-to-create-a-3x3-grid-layout-with-css-grid-sg1ixre5u
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Create a 3x3 Grid Layout with CSS Grid | daily.dev
og:description: A 3x3 grid needs a parent div with nine child divs and four CSS lines: display: grid, gap: 10px, and grid-template-columns and grid-template-rows set to...
og:url: https://daily.dev/posts/how-to-create-a-3x3-grid-layout-with-css-grid-sg1ixre5u
og:image: https://api.daily.dev/og/posts/sg1ixRE5U.png
og:image:alt: How to Create a 3x3 Grid Layout with CSS Grid
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Create a 3x3 Grid Layout with CSS Grid

**[Kirupa](https://daily.dev/sources/kirupa)** · 10 min read · 0 upvotes · 0 comments

## Summary

A 3x3 grid needs a parent div with nine child divs and four CSS lines: display: grid, gap: 10px, and grid-template-columns and grid-template-rows set to repeat(3, 150px). That repeat call is shorthand for 150px 150px 150px. Fixed sizes need 470px of width, so swapping to repeat(3, 1fr) with aspect-ratio: 1 on each cell makes the grid responsive. A tenth item creates an implicit row that is only as tall as its content, and grid-auto-rows: 150px sizes extra rows to match. The older name grid-gap still works as an alias for gap.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.kirupa.com/css/creating_3x3_grid.htm>

## Questions this post answers

### How do I make a 3x3 grid with CSS Grid?

Use a parent div containing nine child divs. On the parent, set display: grid, gap: 10px, and set both grid-template-columns and grid-template-rows to repeat(3, 150px). The browser places the nine children into three columns and three rows. The HTML contains nothing grid-specific; the whole layout comes from those CSS lines.

_Developers sharpening their CSS layout skills follow Grid techniques like this on daily.dev._

### How do I make a CSS Grid 3x3 layout responsive instead of fixed at 150px?

Replace the fixed sizes with grid-template-columns: repeat(3, 1fr), drop grid-template-rows, and give each cell aspect-ratio: 1 so it stays square at any width. A max-width such as 470px stops the grid growing too large. Fixed 150px columns with two 10px gaps need 470px, so narrower screens overflow.

_Anyone building layouts that survive small screens will find more responsive CSS patterns on daily.dev._

### What happens when a CSS Grid with three defined rows gets a tenth item?

The browser creates a fourth row automatically as part of the implicit grid. By default that row is only as tall as its content, so the tenth item looks like a short strip. Setting grid-auto-rows: 150px makes every extra row match the defined ones, and items 10 through 12 then fill a full-size row.

_Developers handling data-driven grids keep up with CSS Grid details on daily.dev._

## Similar posts on daily.dev

- [Get Grid Information using pure CSS](https://daily.dev/posts/get-grid-information-using-pure-css-pfehfxsxb) · CSS Tip · 33 upvotes · 3 comments
- [Responsive Hexagon Grid Using Modern CSS](https://daily.dev/posts/responsive-hexagon-grid-using-modern-css-i4r19n9xf) · CSS-Tricks · 10 upvotes · 0 comments
- [Rebuilding FIFA Standings Layout with CSS Subgrid](https://daily.dev/posts/rebuilding-fifa-standings-layout-with-css-subgrid-didqlh9rj) · Ahmad Shadeed · 62 upvotes · 9 comments
- [My CSS layout strategy](https://daily.dev/posts/my-css-layout-strategy-lfp48ynra) · Blogging and all that Malarkey · 49 upvotes · 2 comments

---

Tags: [#css](https://daily.dev/tags/css), [#html](https://daily.dev/tags/html), [#ui-design](https://daily.dev/tags/ui-design)

[View this post on daily.dev](https://daily.dev/posts/how-to-create-a-3x3-grid-layout-with-css-grid-sg1ixre5u)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Create a 3x3 Grid Layout with CSS Grid","url":"https://daily.dev/posts/how-to-create-a-3x3-grid-layout-with-css-grid-sg1ixre5u","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-create-a-3x3-grid-layout-with-css-grid-sg1ixre5u"},"datePublished":"2026-11-28T06:30:37.539Z","dateModified":"2026-11-28T06:31:02.369Z","description":"A 3x3 grid needs a parent div with nine child divs and four CSS lines: display: grid, gap: 10px, and grid-template-columns and grid-template-rows set to...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bf0ae8f1a2cae2dcce8540e7b39e889e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bf0ae8f1a2cae2dcce8540e7b39e889e?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Kirupa","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Kirupa","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/ff2fdb4927d34b81bd07cd18d6049a98","url":"https://daily.dev/sources/kirupa"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-create-a-3x3-grid-layout-with-css-grid-sg1ixre5u","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"css,html,ui-design","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Kirupa","item":"https://daily.dev/sources/kirupa"},{"@type":"ListItem","position":3,"name":"How to Create a 3x3 Grid Layout with CSS Grid"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-create-a-3x3-grid-layout-with-css-grid-sg1ixre5u#faq","mainEntity":[{"@type":"Question","name":"How do I make a 3x3 grid with CSS Grid?","acceptedAnswer":{"@type":"Answer","text":"Use a parent div containing nine child divs. On the parent, set display: grid, gap: 10px, and set both grid-template-columns and grid-template-rows to repeat(3, 150px). The browser places the nine children into three columns and three rows. The HTML contains nothing grid-specific; the whole layout comes from those CSS lines. Developers sharpening their CSS layout skills follow Grid techniques like this on daily.dev."}},{"@type":"Question","name":"How do I make a CSS Grid 3x3 layout responsive instead of fixed at 150px?","acceptedAnswer":{"@type":"Answer","text":"Replace the fixed sizes with grid-template-columns: repeat(3, 1fr), drop grid-template-rows, and give each cell aspect-ratio: 1 so it stays square at any width. A max-width such as 470px stops the grid growing too large. Fixed 150px columns with two 10px gaps need 470px, so narrower screens overflow. Anyone building layouts that survive small screens will find more responsive CSS patterns on daily.dev."}},{"@type":"Question","name":"What happens when a CSS Grid with three defined rows gets a tenth item?","acceptedAnswer":{"@type":"Answer","text":"The browser creates a fourth row automatically as part of the implicit grid. By default that row is only as tall as its content, so the tenth item looks like a short strip. Setting grid-auto-rows: 150px makes every extra row match the defined ones, and items 10 through 12 then fill a full-size row. Developers handling data-driven grids keep up with CSS Grid details on daily.dev."}}]}
```

