Back to Learn
Pulseaccessibility
HTML Element Has a lang Attribute
What This Audit Checks
This audit verifies that the <html> element includes a lang attribute. This attribute declares the primary language of the page content.
Why It Matters
Screen readers use the lang attribute to load the correct pronunciation engine. Without it, a screen reader may mispronounce every word on the page, making content incomprehensible. Search engines also rely on it for language detection.
How to Fix It
- Add a
langattribute to your<html>element with a valid BCP 47 language tag. - Use the correct subtag for your content. For English, use
en. For British English specifically, useen-GB. For Dutch, usenl. - In Next.js, set the locale in your
next.config.jsor addlangto the<html>element in your root layout.
<!-- Bad: no lang attribute -->
<html>
<head>...</head>
<body>...</body>
</html>
<!-- Good: lang declared -->
<html lang="en">
<head>...</head>
<body>...</body>
</html>
// Next.js App Router: app/layout.tsx
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
How Pulse Tracks This
Pulse flags this audit in your Lighthouse accessibility score. When the audit fails, Pulse shows which elements triggered it so you can fix them directly.