The lang Attribute and Screen Readers
Declare page and element language for correct pronunciation.
What the lang Attribute Does
The lang attribute declares the language of an element's content using a BCP-47 language tag. Screen readers use it to select the correct pronunciation engine and voice, and search engines use it to index by language.
Setting on the html Element
Every page must declare its primary language on the root: <html lang="en"> for English, <html lang="tr"> for Turkish, <html lang="ja"> for Japanese. Without it, screen readers fall back to the user's system default, often mispronouncing every word.
<!doctype html>
<html lang="en">
<head><meta charset="utf-8"><title>...</title></head>All lessons in this course
- The lang Attribute and Screen Readers
- dir=rtl for Right-to-Left Text
- The bdi and bdo Elements
- charset and Unicode Handling Special Characters