3.1. Provide the primary language of the page with the lang attribute on the <html> tag

In order to ensure a proper presentation of text content to the end user, the primary language should be declared on each page.

Use the lang attribute on the <html> tag.

For example, for an English page use:

<html lang="en">

Tip

Populate the lang attribute with the relevant language code (or in some cases three letters).

Some common codes are:

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

Find out more

Comments

Add a comment

Required fields are marked *.

Back to top