<html> element must have a lang attribute

Serious

What is the problem?

The html-has-lang rule ensures that every HTML document has a lang attribute specifying the language of the content.

Impacted Groups

Blind
Deafblind
Cognitive

Why is this important?

The lang attribute helps screen readers and other assistive technologies to pronounce words correctly, especially in languages with different pronunciations or character sets. It also helps browsers select the appropriate language-specific fonts and styles.

How to solve this issue

To fix this, add a lang attribute to the <html> element and set it to the appropriate language code, such as en for English or fr for French. This will improve the accessibility and usability of your website for users who rely on assistive technologies.

Rule Information

Rule ID

html-has-lang

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.