<html> element must have a valid value for the lang attribute

Serious

What is the problem?

The html-lang-valid accessibility rule ensures that the lang attribute of the <html> element has a valid language code.

Impacted Groups

Blind
Deafblind
Cognitive

Why is this important?

A valid language code helps screen readers and other assistive technologies to correctly pronounce text and translate content. It also aids search engines in indexing content appropriately. Without a valid language code, users may encounter difficulties understanding the content, especially those who rely on assistive technologies.

How to solve this issue

To fix this issue, set the lang attribute of the <html> element to a valid language code, such as en for English or fr for French. This will ensure that assistive technologies can properly process and present the content to users.

Rule Information

Rule ID

html-lang-valid

Severity

Serious

Manual Review Required

No

Rule Group

WCAG 2.0 Level A & AA Rules

Guidelines

  • WCAG 2.1 (A)
  • WCAG 2.0 (A)
  • WCAG 2.2 (A)
  • 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.