What WCAG 3.1.1 Requires
The page's primary language must be set in the HTML lang attribute, so screen readers use the correct pronunciation rules and translation tools work correctly.
Can AccessBell Test This Automatically?
Yes. AccessBell's scanner runs axe-core, which includes 3 rules that catch code-level failures of this criterion:
html-has-lang— Ensure every HTML document has a lang attribute (details (opens in a new tab))html-lang-valid— Ensure the lang attribute of the <html> element has a valid value (details (opens in a new tab))html-xml-lang-mismatch— Ensure that HTML elements with both valid lang and xml:lang attributes agree on the base language of the page (details (opens in a new tab))
This criterion is included in: WCAG 2.2 AA Checker, WCAG 2.1 AA Checker, ADA Compliance Checker, Section 508 Checker, EN 301 549 Checker.
How to Test It by Hand
View the page source and check that the <html> tag has a lang attribute matching the page's language.
Common Failures
- The <html> tag has no lang attribute.
- The lang attribute uses an invalid or incorrect language code.
Example Fix
- Declare the page language. Add a lang attribute to the html element so screen readers use the right pronunciation.
- Mark language changes. Wrap phrases in another language with their own lang attribute.
<!doctype html>
<html lang="en">
<head>...</head>
<body>
<p>Our motto is <span lang="fr">savoir-faire</span>.</p>
</body>
</html> Related Criteria in Readable
WCAG 3.1.1 Questions
What does WCAG 3.1.1 require?
The page's primary language must be set in the HTML lang attribute, so screen readers use the correct pronunciation rules and translation tools work correctly.
Can AccessBell test WCAG 3.1.1 automatically?
Yes. AccessBell runs 3 automated rules that can catch failures of this criterion, including in our WCAG 2.2 AA Checker, WCAG 2.1 AA Checker, ADA Compliance Checker, Section 508 Checker, EN 301 549 Checker.
What level is WCAG 3.1.1?
Level A, added in WCAG 2.0.
Sources
- W3C: Understanding 3.1.1 Language of Page (opens in a new tab)
- W3C: Web Content Accessibility Guidelines (WCAG) 2.2 (opens in a new tab)
This page explains a technical standard and is not legal advice. See our disclaimer.