0Pricing
HTML Academy · Lesson

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

  1. The lang Attribute and Screen Readers
  2. dir=rtl for Right-to-Left Text
  3. The bdi and bdo Elements
  4. charset and Unicode Handling Special Characters
← Back to HTML Academy