R022: text-align: left explicitly set on majority-Arabic text
Arabic is read from the right, so a block held to the left edge gives each line a ragged starting point and pulls the text away from where the reader's eye begins.
The check
- Id
- R022
- Category
- Direction and bidi
- Default severity
When it fires
Visible text that is mostly Arabic, at least 10 Arabic letters, computes to
text-align: left. A browser computes an unset alignment asstart, soleftis always something an author wrote.Fix: Replace text-align: left with text-align: start.
What it leaves alone
Text that is mostly Latin, and every other alignment: start, end, center, justify and right.
Broken, then fixed
.card p {
text-align: left;
}.card p {
text-align: start;
}Check it by hand
Select the text in the Elements panel and run getComputedStyle($0).textAlign in the DevTools console. left on Arabic text is the finding, and the Styles pane shows which rule wrote it.
What the report shows you
Each R022 finding carries the fields below that apply to it, so you can see why it fired without rerunning the scan.
- sample
- The text, cut to 120 characters.
- cssSelectors
- The selectors of the rules that set
text-align: lefton it, when the stylesheet could be read.
Components that pass it by construction
These Ritla UI components satisfy R022 by how they are built. Used as documented, they do not bring this defect onto your page.
More direction and bidi checks
- Forced-LTR container, or a bidi override, over Arabic content
- Unisolated bidi hazards: phones, emails, Latin tokens inside Arabic text
- Text inputs rendered LTR where Arabic input is expected
- Punctuation rendering at the wrong visual end of Arabic text
- Directional icon pointing against the sequence its control advances
Does your page trip R022?
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