CSS logical properties: style against writing direction
Answer: Logical properties can change if the text direction or writing mode changes. Use logical properties such as inline-size, block-size, and margin-inline for layout dimensions and spacing.
Flow-relative sizing and spacing
A common pattern is a text label with an icon that sits to the left, but that only works when the text direction is left to right.
If the text direction changes to right-to-left, that physical layout can sit the icon up against the text.
Logical properties can change if the text direction or writing mode changes.
Flow-relative equivalents include max-inline-size and max-block-size, and also min-inline-size and min-block-size.
You can use padding-block-start, margin-inline-start, and inset-block-start instead of physical sides.
When to prefer them in layout
Reach for intrinsic sizing and logical properties before hardcoded dimensions or complicated media queries.
Use logical properties such as inline-size, block-size, margin-inline, padding-block, and inset-inline-start for layout dimensions and spacing.
See also
Claims
- id: C1 claim: Logical properties can change if the text direction or writing mode changes. source: S1 evidence: "change if the text direction or writing mode changes"
- id: C2 claim: max-inline-size and max-block-size are flow-relative equivalents. source: S1 evidence: "flow-relative equivalents are max-inline-size and max-block-size"
- id: C3 claim: Prefer logical properties for layout dimensions and spacing. source: S2 evidence: "Use logical properties ( inline-size , block-size , margin-inline"
- id: C4 claim: Reach for logical properties before hardcoded dimensions. source: S2 evidence: "logical properties, and aspect-ratio before resorting to hardcoded dimensions"
Sources
- [S1] Logical properties. web.dev. https://web.dev/learn/css/logical-properties . License: CC-BY-4.0. Accessed 2026-11-23.
- [S2] CSS: Modern Architecture. 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, Logical properties; Chrome Developers, CSS: Modern Architecture. 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, Logical properties; Chrome Developers, CSS: Modern Architecture. 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 logical properties: style against writing direction." iinventedlight Library, iil:note:k0f63vn5, version of 2026-11-23. https://iinventedlight.com/library/notes/css-logical-properties/. License: CC-BY-4.0.
@misc{iil_note_k0f63vn5,
author = {{iinventedlight}},
title = {{CSS logical properties: style against writing direction}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-23},
url = {https://iinventedlight.com/library/notes/css-logical-properties/},
note = {Permanent ID iil:note:k0f63vn5. 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-logical-properties.schema.json (schema; CC-BY-4.0)
- css-logical-properties.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-logical-properties.md.