CSS layout: choose a method for rows, columns, or both
Answer: CSS provides various ways to solve layout problems. Those problems can sit on a horizontal axis, a vertical axis, or even both. Often you may need more than one layout method to solve your problem. Lean on the browser's layout engine when possible.
Ways to solve a layout problem
CSS provides various ways to solve layout problems.
Those problems can sit on a horizontal axis, a vertical axis, or even both.
Your elements display in normal flow.
Choosing the right layout method for a context can be hard.
Often you may need more than one layout method to solve your problem.
A decision sequence in the layout guide
Lean on the browser's layout engine when possible.
That can give better performance.
Reach for intrinsic sizing and logical properties before hardcoded dimensions.
Walk the decision tree top-to-bottom and stop at the first match.
Layouts can be nested within each-other.
Each decision is based on the use-case for that container.
See also
Claims
- id: C1 claim: CSS provides various ways to solve layout problems on one axis or both. source: S1 evidence: "various ways to solve layout problems"
- id: C2 claim: You may need more than one layout method to solve a problem. source: S1 evidence: "more than one layout method to solve your problem"
- id: C3 claim: Lean on the browser's layout engine when possible. source: S2 evidence: "Lean on the browser's layout engine when possible"
- id: C4 claim: Walk the decision tree and stop at the first match. source: S2 evidence: "Walk the decision tree top-to-bottom and stop at the first match"
Sources
- [S1] Layout. web.dev. https://web.dev/learn/css/layout . License: CC-BY-4.0. Accessed 2026-11-23.
- [S2] CSS Layouts and Responsive Design. Chrome Developers. https://developer.chrome.com/docs/modern-web-guidance/guides/css/css-layout . 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, Layout; Chrome Developers, CSS Layouts and Responsive Design. 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, Layout; Chrome Developers, CSS Layouts and Responsive Design. 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 layout: choose a method for rows, columns, or both." iinventedlight Library, iil:note:a6yz9kb2, version of 2026-11-23. https://iinventedlight.com/library/notes/css-layout/. License: CC-BY-4.0.
@misc{iil_note_a6yz9kb2,
author = {{iinventedlight}},
title = {{CSS layout: choose a method for rows, columns, or both}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-23},
url = {https://iinventedlight.com/library/notes/css-layout/},
note = {Permanent ID iil:note:a6yz9kb2. 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-layout.schema.json (schema; CC-BY-4.0)
- css-layout.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-layout.md.