The lang Attribute Playground

The village’s volunteer welcome page: the browser answers the lang that rules each run through :lang(), the <q> quotes and hyphens: auto it picks, and Putar…

Why it matters

Many think lang is just for SEO. In fact it decides the screen reader’s voice (NVDA, VoiceOver, TalkBack), hyphens: auto hyphenation, the marks of <q>, :lang() rules and the spelling dictionary. A missing or wrong <html lang> is always a WCAG audit finding (3.1.1 Language of Page, 3.1.2 Language of Parts).

The key idea

A text’s language = the nearest lang above it

Common mistakes

Try it in this playground