<html lang="en">

What is it?

The <html> element is the root element of an HTML page. In <html lang="en">, lang is an attribute, and en is its value. The value indicates that the page’s main language is English. [4] [6]

Why is it used?

Declaring the page’s language helps screen readers pronounce its content correctly and helps search engines identify its language. [4] [6]

Example on This Page

This page uses <html lang="en"> near the top of its HTML file. The screenshot below shows where the language attribute appears in the opening tag.

Screenshot of an opening HTML tag with the language attribute set to English
The lang="fr" attribute in an opening HTML tag.
Source: Screenshot of example from [4]

What I Learned

While making this page, I learned that the opening <html> tag can include the lang attribute to help identify a page’s main language. I also learned that en is the value of the lang attribute, and I practiced adding that attribute to this page’s own HTML.