lang attribute must have a valid value

Serious

What is the problem?

The valid-lang rule ensures that the lang attribute is used correctly on HTML elements, specifying the language of the content.

Impacted Groups

Blind
Deafblind
Cognitive

Why is this important?

Using invalid or missing lang attributes can hinder the ability of screen readers and other assistive technologies to accurately interpret and translate content. This can lead to a degraded user experience, especially for users who rely on these tools to access information.

How to solve this issue

To fix this, use valid language codes, such as en for English or fr for French, within the lang attribute on the <html> element. This helps assistive technologies understand the language of the content and provide appropriate translations or pronunciations.

Rule Information

Rule ID

valid-lang

Severity

Serious

Manual Review Required

No

Rule Group

WCAG 2.0 Level A & AA Rules

Guidelines

  • WCAG 2.1 (AA)
  • WCAG 2.0 (AA)
  • WCAG 2.2 (AA)
  • Trusted Tester
  • EN 301 549

Customise Guidance

You can customise each accessibility rule in SiteAlly with your own guidance, instructions and even links to your own organisation specific documentation.

Enable your website editors to resolve issues quickly with SiteAlly.

Ready to make your website accessible?

SiteAlly provides automated accessibility monitoring, detailed reports, and step-by-step guidance to help you achieve and maintain compliance.