Element

html

Error Type

Known

Guidelines

  • WCAG 2.0 (Level A)
    Guideline Group3.1 Readable: Make text content readable and understandable.
    Guideline SubgroupSuccess Criteria 3.1.1 Language of Page (A)
  • WCAG 2.0 (Level AA)
    Guideline Group3.1 Readable: Make text content readable and understandable.
    Guideline SubgroupSuccess Criteria 3.1.1 Language of Page (A)
  • WCAG 2.0 (Level AAA)
    Guideline Group3.1 Readable: Make text content readable and understandable
    Guideline SubgroupSuccess Criteria 3.1.1 Language of Page (A)

Requirement

Reading order direction is marked using the html element's dir attribute if the document's primary language is read right to left.

Error

Right to left reading order not marked or marked incorrectly.

Short Description

The dir attribute allows assistive technology to render the content of the page in its intended order.

How To Repair

Add a dir attribute to your html element.

Repair Example

<html dir="rtl" />

Steps To Check

Procedure

1. Determine the reading order of the document's primary language.
2. Check if there is a dir attribute on the html element.
3. Check if the dir attribute's value is "rtl" for languages that are read left-to-right or "ltr" for languages that are read right-to-left.

Expected Result

1. Reading order direction is marked using the html element's dir attribute if the document's primary language is read right to left.

Failed Result

1. Add a dir attribute to the html element and set its value to "rtl".

Examples

Pass Examples

Document's primary reading order is right to left and dir attribute is set.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="he" lang="he" dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
<title>ATRC Testfile - Check #273.2 - Negative</title>
</head>
<body>

<p></p>


</body>
</html>

Fail Examples

Document's primary reading order is right to left but dir attribute is not set.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ar" lang="ar">
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
<title>ATRC Testfile - Check #273.1 - Positive</title>
</head>
<body>

<p></p>

</body>
</html>
Web site engine's code is copyright © 2023
Inclusive Design Institute