Skip to content
Web Design & Development

CSS Logical Properties: What Actually Works

CSS properties that describe layout in terms of the text flow, such as margin-inline-start and padding-block, rather than physical directions like left and top.

MediaScaleUp Editorial Team 2 min read 10 views
CSS Logical Properties: What Actually Works

What is at stake

Logical properties make layouts adapt automatically to right-to-left languages and vertical writing modes, which matters for multilingual sites.

The playbook

  1. Use logical properties for spacing and positioning in new code
  2. Set dir on the html element for right-to-left languages
  3. Test layouts with dir="rtl"
  4. Keep physical properties only where direction is truly fixed
  5. Update design tokens to logical names

Where it goes wrong

Avoid:

  • Hard-coded left and right in components that may be translated
  • Flipping layouts with separate RTL stylesheets
  • Mixing logical and physical properties inconsistently
  • Icons that should mirror but do not
What to do and what to avoid with CSS logical properties, side by side
Good practice against the usual mistakes, from the sources listed below.

The numbers behind it

Published figures for CSS Logical Properties
MeasureFigure
Inline axisthe direction text runs, left to right in English
Block axisthe direction blocks stack, top to bottom in English
Examplesmargin-inline, padding-block, inset-inline-start and border-inline-end
Browser supportwidely supported in current browsers

Getting outside help

When to hand it over: Bring in help when localizing a site into Arabic, Hebrew or other right-to-left languages.

Where this comes from

  • MDN Web Docs — CSS logical properties and values
  • W3C — Structural markup and right-to-left text in HTML

The figures and practices above come from the sources listed.

Working on something like this?

We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

MediaScaleUp Editorial Team

Articles here are researched, written and checked by the MediaScaleUp studio team before they are published, and dated when they are reviewed.

Keep reading

More in Web Design & Development