Course contentsShow
← Web Development
Lesson 465 of 2,9828. Advanced CSS Selectors and FeaturesFree lesson

When to Use Logical vs Physical Properties

Learn when logical properties improve maintainability and when physical properties are still the better choice.

When to Use Logical vs Physical Properties

You'll learn when logical properties improve your code and when physical properties remain the practical choice.

Now that you understand logical properties, the key question is: when should you actually use them? The answer depends on your project's needs and audience.

Use Logical Properties When:

Internationalization matters. If your site will be translated into languages with different writing modes (Arabic, Hebrew, Japanese vertical text), logical properties handle direction changes automatically. Instead of rewriting margins for RTL layouts, margin-inline-start adapts without extra code.

Building reusable components. A card component with padding-block: 1rem; padding-inline: 2rem; works correctly whether users read left-to-right or right-to-left. The component "just works" in any context.

Working on modern, long-term projects. Logical properties represent the web's future direction. Starting with them now means less refactoring later.

Stick with Physical Properties When:

Truly directional needs exist. A decorative element that must stay on the left side regardless of language should use left: 0, not inset-inline-start: 0. Physical properties express "always this exact edge."

Browser support is critical. While modern browsers support logical properties well, legacy browsers (IE11) don't. If you must support older environments, physical properties are safer.

Team familiarity matters. If your team is unfamiliar with logical properties and the project has no internationalization needs, introducing them may add confusion without benefit.

Quick prototypes. When rapidly sketching ideas, physical properties are faster and more familiar.

Think of It This Way

Logical properties are like saying "start of the line" instead of "left." Use them when the direction might change. Physical properties are like GPS coordinates—use them when you mean an absolute position.

Key Takeaway: Choose logical properties for flexible, international-ready layouts; use physical properties when you need directional certainty or legacy support.