Menu

RTL Without Debt: Building Arabic-First Interfaces in HTML and CSS
📰

RTL Without Debt: Building Arabic-First Interfaces in HTML and CSS

DEV Community: css·Ashraf Alrashidi·about 6 hours ago
#6E2y4Fn5
#devtocss#devto#dev#arabic#direction
Long article (851 words) — no AI summary yet.
Reading 0:00
15s threshold

Most teams add Arabic at the end. The English interface ships, then someone is asked to "support Arabic", and a week later the layout looks like a mirrored photograph of the original. Buttons sit on the wrong side, numbers point backwards in mixed sentences, and every new component reopens the same argument.

There is a cheaper order: decide the direction at the root, use CSS properties that do not know left from right, and let the browser do the mirroring. This is how I build Arabic-first interfaces, including my Etamen app ( https://ashraf-alrashidi.github.io/etamen/ ).

Set the direction once, on the root element

<html lang = "ar" dir = "rtl" >

Enter fullscreen mode

Exit fullscreen mode

That single attribute flips the inline base direction of the whole document. Everything that follows from it, including text alignment, list markers, table column order and the default direction of scrollbars, comes for free.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.