<html> element has a valid value for its [lang] attribute

The page has a valid language code so screen readers pronounce content correctly.

On this page

Impact

ScanGov impact ratings

About

Specifying a valid BCP 47 language helps screen readers announce text properly. Learn how to use the lang attribute.

Risks

Screen readers mispronounce content, confusing users.

Why it's important

Helps screen readers pronounce content correctly by identifying the language of the page and its elements.

User stories

As a screen reader user, I want the page language to be correctly identified so that content is pronounced properly.

Code

Failing pattern:

<!-- Fail: invalid BCP 47 value -->
<html lang="english">

Passing pattern:

<!-- Pass: valid BCP 47 language code -->
<html lang="en">

Error

ScanGov messaging when a site fails a standard:

Failed: <html> element has a valid value for its [lang] attribute

Guidance

Indicators

On this page