Language Attribute (lang)

The language attribute (lang) specifies the primary language of a webpage or specific content section. This attribute enables screen readers and translation tools to use the correct pronunciation, voice, and linguistic rules when reading text aloud.

For example, a webpage written in English should declare <html lang="en">, while a paragraph in French might use <p lang="fr">. Without this information, assistive technologies may mispronounce words or apply incorrect reading rules.

It’s also essential to update the language attribute when switching languages within content to ensure smooth and accurate comprehension for multilingual audiences.

Accessible outcome: Properly defined language attributes ensure that assistive technologies can accurately interpret and pronounce content, improving comprehension for users who rely on speech output.