CSS Grid: two-dimensional layout in rows and columns
Answer: CSS Grid is a layout method designed for two-dimensional content, in rows and columns at the same time. Flexbox lays out in one dimension, and there is synergy when using the two together.
What grid adds
Grid is a layout method designed for two-dimensional content. That means laying things out in rows and columns at the same time.
You first define the rows and columns. Items can be placed by you, or the browser can auto-place them into the cells.
Direct children of the grid container will be automatically placed onto this grid.
The grid is made of lines that run horizontally and vertically. Numbering starts from 1.
Grid and Flexbox
Flexbox made a lot of complex layout tasks easier, but screens commonly have a second dimension.
Grid arranges in two dimensions. Flexbox lays out in one dimension. There is synergy when using the two together.
Despite the similarities in concept and syntax, do not think of them as competing layout techniques.
See also
Claims
- id: C1 claim: Grid is designed for two-dimensional content in rows and columns. source: S1 evidence: "layout method designed for two-dimensional content"
- id: C2 claim: Direct children of the grid container are auto-placed unless you position them. source: S1 evidence: "Direct children of the grid container will be automatically placed"
- id: C3 claim: Grid lines run horizontally and vertically and are numbered from 1. source: S1 evidence: "Lines are numbered starting from 1"
- id: C4 claim: Grid is two-dimensional; Flexbox lays out in one dimension. source: S2 evidence: "Grid arranges in two dimensions, while Flexbox lays out in one"
Sources
- [S1] CSS Grid layout. web.dev. https://web.dev/learn/css/grid . License: CC-BY-4.0. Accessed 2026-11-23.
- [S2] Getting started with CSS Grid. Chrome Developers. https://developer.chrome.com/blog/css-grid . License: CC-BY-4.0. Accessed 2026-11-23.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: web.dev, CSS Grid layout; Chrome Developers, Getting started with CSS Grid. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. CC-BY-4.0 (https://developers.google.com/site-policies). Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License. Copyright Google LLC. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: web.dev, CSS Grid layout; Chrome Developers, Getting started with CSS Grid. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. CC-BY-4.0 (https://developers.google.com/site-policies). Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License. Copyright Google LLC.
Cite this
iinventedlight. 2026. "CSS Grid: two-dimensional layout in rows and columns." iinventedlight Library, iil:note:11sph954, version of 2026-11-23. https://iinventedlight.com/library/notes/css-grid-basics/. License: CC-BY-4.0.
@misc{iil_note_11sph954,
author = {{iinventedlight}},
title = {{CSS Grid: two-dimensional layout in rows and columns}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-23},
url = {https://iinventedlight.com/library/notes/css-grid-basics/},
note = {Permanent ID iil:note:11sph954. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- css-grid-basics.schema.json (schema; CC-BY-4.0)
- css-grid-basics.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/css-grid-basics.md.