Welcome to our free HTML tutorial. This tutorial is based on Webucator's Introduction to HTML Training course.
The lang
attribute is used to tell the browser (or other user agent) the language contained within an element. While it is not required, the W3C recommends that lang
be included in the html
tag of all HTML documents, like so:
<html lang="en">
According to the W3C, this is helpful in:
If a portion of the page is written in a different language, you can wrap that portion in a tag that includes the lang
attribute, like this:
<span lang="fr">Bonjour, mon ami!</span>
This tutorial is based on Webucator's Introduction to HTML Training Course. We also offer many other HTML Training courses. Sign up today to get help from a live instructor.