R001: document direction missing, contradicted, or declared only in CSS
Whether <html> says right-to-left and the page actually renders that way: a missing or overridden dir flips the whole layout for an Arabic reader.
The check
- Id
- R001
- Category
- Document and metadata
- Default severity
When it fires
The page is Arabic,
<html>has nodiror saysdir="ltr", and nothing in the CSS makes it right-to-left. The whole layout runs left-to-right.Fix: Add dir="rtl" to the root element:
<html dir="rtl" lang="ar">.<html dir="rtl">is declared, but a stylesheet setsdirection: ltronhtmlorbody, so the page renders left-to-right anyway. Reading the HTML alone will not find it.Fix: Find the rule setting
direction: ltron html or body and remove it, or scope it to the elements that genuinely need it. The attribute cannot win against a stylesheet.The layout renders right-to-left, but
<html>does not saydir="rtl": the direction comes from CSS or from<body dir="rtl">. It looks right; what is missing is the declaration.Fix: Set dir="rtl" on the root element:
<html dir="rtl" lang="ar">. CSS moves the boxes; the attribute is what:dir(), form controls,dir="auto"and assistive technology resolve against.
What it leaves alone
Pages that are not Arabic, and a page that declares right-to-left on <html> and renders that way. It judges the root only: a dir on an element inside the page is R020's concern.
Broken, then fixed
<html lang="ar">
<body>
<h1>نظّم عمل فريقك في مكان واحد</h1>
</body>
</html><html dir="rtl" lang="ar">
<body>
<h1>نظّم عمل فريقك في مكان واحد</h1>
</body>
</html>Check it by hand
Open DevTools on the page and run [document.documentElement.dir, getComputedStyle(document.body).direction] in the console. A healthy Arabic page prints ['rtl', 'rtl']. An empty first value is the missing declaration; ['rtl', 'ltr'] means a stylesheet is overriding it.
What the report shows you
Each R001 finding carries the fields below that apply to it, so you can see why it fired without rerunning the scan.
- dirAttr
- The
dirattribute on<html>exactly as written, or nothing when it is absent. - computedRootDirection
- The direction the page actually renders in, read from the computed style of
body. - detectionSignals
- Why the page counts as Arabic: an Arabic
lang, anrtldir, or at least 40% Arabic letters in the visible text. - arabicLetterRatio
- The share of letters in the visible text that are Arabic, from 0 to 1.
More document and metadata checks
- html[lang] missing, non-Arabic, or contradicting detected content
- hreflang alternate set lacks any Arabic entry on an Arabic page
- <title> or meta description majority-Latin on an Arabic page
- OpenGraph/Twitter metadata untranslated or og:locale missing/invalid
- Canonical URL points at a different-locale variant
Does your page trip R001?
Paste a URL. Ritla renders the page on desktop, tablet and mobile, runs every check, and shows the top issues with screenshot evidence.
Scan a page freeBrowse the checks