Physical properties (margin-left, top, width) are tied to the screen. Logical properties are tied to the writing mode and direction of the element:
- The inline axis is the direction text runs within a line; the block axis is the direction lines and blocks stack.
- Each axis has a start and an end.
| Logical | ltr, horizontal |
rtl, horizontal |
vertical-rl |
|---|---|---|---|
margin-inline-start |
left | right | top |
margin-block-start |
top | top | right |
inline-size |
width | width | height |
The families cover margins, padding, borders and border radii (border-start-end-radius), insets (inset-inline-start), sizes (inline-size, max-block-size), plus values such as text-align: start and float: inline-start. Two-value shorthands set start then end: padding-inline: 4px 12px.
Why prefer them: a sidebar icon with margin-inline-end and a quote with border-inline-start are correct when the page is translated into Arabic or Hebrew (dir="rtl"), with no [dir=rtl] overrides. Most UI spacing is about reading order, not screen sides, and logical properties say that. Keep physical properties where the screen really matters, such as a drop shadow's offset. Full support for vertical and mixed scripts needs more than this; logical properties are the base.
How they cascade: a logical property and the physical one it maps to form a pair that cascades together. In margin-inline-start: 1px; margin-left: 2px; in ltr, the later declaration wins and the left margin is 2px. Each element maps using its own writing mode and direction.
The four-value shorthands (margin, padding) stay physical. A logical keyword (margin: logical 1px 2px) is in the draft, marked as almost certain to change, and no browser supports it.
Support: the -inline/-block shorthands since Chrome 87, Firefox 66, Safari 14.1.