Full answer
Physical properties name a screen side: margin-left, padding-right, border-top, width. Logical properties name a side relative to the text direction and writing mode: margin-inline-start, padding-inline-end, border-block-start, inline-size.
In a left-to-right language like English, "inline start" is the left. In a right-to-left language like Arabic or Hebrew, it is the right. In vertical writing modes the block and inline axes also turn. When you write layout in logical terms, one stylesheet works for all of them, with no separate right-to-left overrides.
The mapping:
inlineis the direction text runs.blockis the direction blocks stack.margin-inline-startreplacesmargin-leftin left-to-right text.padding-blocksets both top and bottom in horizontal writing.inset-inline-startreplacesleftfor positioned elements.inset: 0is the shorthand for all four sides.text-align: startandendreplaceleftandright.inline-sizeandblock-sizereplacewidthandheightin horizontal text.border-start-start-radiusand its siblings round corners logically.
In the left-to-right block, the note has a 24px margin on its left and a teal bar on its left, and the badge is in the top right corner. In the dir="rtl" block, the same CSS gives a 24px margin on the right, the bar on the right, and the badge in the top left corner.
Logical properties are not a replacement for every physical one. A drop shadow that must fall towards the bottom right regardless of language, or a graphic that is tied to a specific side, can stay physical. Check current support tables if you target very old browsers.
<style>
.note {
margin-inline-start: 24px;
padding-inline: 12px;
border-inline-start: 4px solid teal;
text-align: start;
}
.badge { position: absolute; inset-block-start: 0; inset-inline-end: 0; }
.wrap { position: relative; width: 300px; }
</style>
<div class="wrap" id="ltr"><p class="note" id="p1">Fees are due on the first of each month.</p><span class="badge" id="b1">New</span></div>
<div class="wrap" dir="rtl" id="rtl"><p class="note" id="p2">الرسوم مستحقة في أول كل شهر</p><span class="badge" id="b2">New</span></div>Run in Chrome 156 (headless) as a page; the snippet is wrapped in a minimal HTML document with doctype, charset and viewport meta tag. Two full runs gave identical results, and the measured values in the answer come from them.
Key points
- inline is the text direction axis; block is the stacking direction.
- margin-inline-start replaces margin-left in left-to-right text and flips in right-to-left.
- inset-inline-end, text-align: start and inline-size are logical equivalents.
- Direction comes from dir or writing-mode.
- Some physical properties, like a shadow direction, can stay physical.
Common mistakes
- mixing margin-left in one place and margin-inline-start in another for the same layout, then wondering why right-to-left breaks.
- forgetting the dir attribute or lang on the html element. Direction comes from dir (or the writing mode in CSS), not from the language alone.
Follow-ups
- what does inline-size mean in a vertical writing mode?
- What is the logical equivalent of width in a vertical writing mode?
- How does text-align: start differ from left?
Tips
- When starting a new project, write margins, paddings and positions logically from day one. It costs nothing and saves a rewrite when the site gets a right-to-left language.
- Give the right-to-left example: the same CSS puts the margin on the right. It is the point of the feature.
- Say you write new code logically by default.