← All notes

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

Sources

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

Permanent ID: iil:note:a6yz9kb2

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.},
}

Markdown

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.

All artifact files (JSON index)

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.