Module lessons (2/4)
CSS Logical Properties & Instant LTR/RTL Support
Replace physical left/right offsets with margin-inline-start, padding-block, inset-inline, and logical borders.
What you'll learn in this lesson
- Replace physical directional properties (
margin-left,padding-right,border-left,top/left) with writing-mode-aware CSS Logical Properties. - Translate any design component cleanly for global audiences (LTR English/Italian ↔ RTL Arabic/Hebrew/Urdu) with zero duplicate
.rtloverrides. - Map logical axes (
inline= text reading flow;block= stacking direction) across padding, margin, borders, radii, and absoluteinset.
Overview
Look at any traditional stylesheet containing border-left: 4px solid blue; padding-left: 16px; on a blockquote. Switch <html dir="rtl"> for Arabic or Hebrew readers, and suddenly that decorative accent bar stays orphaned on the wrong side of right-aligned text!
CSS Logical Properties swap hardcoded screen directions (left / right / top / bottom) for reading directions (inline-start / inline-end along a line of text; block-start / block-end stacking down the page):
Sections covered in this lesson
- 1Building Worldwide Interfaces Without Duplicate RTL CSS
- 2Compare Physical vs Logical CSS in RTL Live
Unlock "CSS Logical Properties & Instant LTR/RTL Support" and the full Modern HTML & CSS curriculum
Replace physical left/right offsets with margin-inline-start, padding-block, inset-inline, and logical borders.
Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in Modern HTML & CSS plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.