w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it

head lang attribute

The lang attribute on the head element:

Recommendation: specify the language of the document on the html root element; it is considered good practice.


16.lang=language code<head lang="en"> ... <⁄head>
<head lang="fr"> ... <⁄head>

Video demonstration head lang attribute

HTML5 head lang attribute Tutorial

min video details
00:10 page's content is in French
00:20 we can add the lang attribute, with an "fr" value to the html root element
00:28 but title's page is in English
00:41 we can add the lang attribute with an "en" value straight to title or to head element
head intro head occurrences head browser display head parents - children head syntax