Menu

An RTL checklist for bilingual English/Arabic websites
📰

An RTL checklist for bilingual English/Arabic websites

DEV Community: html·Oxedge·about 23 hours ago
#UNiZ2IsO
#devto2#devto#dev#arabic#enter
Reading 0:00
15s threshold

We build a lot of English/Arabic sites for businesses in the UAE, and the same right-to-left (RTL) issues come up on almost every project. Here's the checklist we run before launch.

1. Set direction and language on the root

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

Enter fullscreen mode

Exit fullscreen mode

Set both per page, not with JavaScript after load. Screen readers, search engines and the browser's text shaping all rely on lang , and dir controls layout from the first paint.

2. Use logical CSS properties

Replace physical properties with logical ones so one stylesheet works in both directions:

/* instead of margin-left / padding-right / left */ .card { margin-inline-start : 1rem ; padding-inline-end : 1.5rem ; } .badge { inset-inline-start : 0 ; } .text { text-align : start ; }

Enter fullscreen mode

Exit fullscreen mode

Flexbox and grid already follow dir , so most layouts flip for free once the physical properties are gone.

3.…

Continue reading — create a free account

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