3.1.1. Use the lang attribute in the <html> tag to define the main language of the page

To ensure the correct reproduction of text content, a declaration of the main language must be included on each page. Use the lang attribute in the <html> tag for this.

For example, for a page in French, specify:

<html lang="fr">


To enter the lang attribute, you need to use the two-letter ISO 639-1 code, or if it is not available, the three-letter ISO 639-2 code.

The main codes to be used are as follows:

  • en for English.
  • fr for French.
  • es for Spanish.
  • de for German.
  • it for Italian.

The up-to-date, exhaustive, list of codes is maintained at the following address: http://www.loc.gov/standards/iso639-2/php/English_list.php.

notices/html-css/renseigner-la-langue-principale-de-la-page-avec-l-attribut-lang-sur-la-balise-html.txt · Last modified: 30 December 2013 at 17:35 by Sébastien Delorme (Atalan)

Project coordinated by Atalan.

In partnership with: