Specify the primary language of the page
Accessibility isn’t only about avoiding violations — it’s about ensuring your product can be used confidently by everyone. This guide explains the principle of this rule, shows what goes wrong in real-world code, and provides a verified fix that meets WCAG and the European Accessibility Act (EAA).
Why this matters and how to fix it
Why this matters
Assistive technologies rely on the page's language to use correct pronunciation and grammar rules. Missing or incorrect `lang` attributes can cause mispronunciation and confusion.
How to fix this issue
Add a valid `lang` attribute on the <html> element matching the page’s primary language.
Developer guidance
Use ISO language codes (e.g., `en`, `sv`, `de`). Avoid setting incorrect locale variants.
Code examples
Incorrect Implementation
<html>
Correct Implementation
<html lang='en'>
Trusted by organizations across Europe working toward WCAG and EAA conformance