html-has-langserious
Fix html-has-lang axe errors
The page does not declare its default language, so screen readers may choose the wrong pronunciation rules.
Affected users
Screen reader users, translation tools, and users with reading support software.
WCAG mapping
3.1.1 Language of Page (A)
Detection
wcagc reports missing or empty html lang attributes and maps them to WCAG 3.1.1.
Failing markup
<html>
<body>...</body>
</html>Fixed code
<html lang="en">
<body>...</body>
</html>Sources and standards
FAQ
What if a page contains several languages?
Set the main page language on html, then mark passages in another language with their own lang attribute.
Is this only for screen readers?
No. Language metadata also helps browser features, translation, spell-checking, and search systems.
One rule rarely travels alone
Run a page through wcagc to find this rule, related WCAG issues, affected selectors, and manual checks that automation cannot judge.
Scan a page