Specify your language

The language attribute in HTML helps assistive technology (AT) like screen readers decide which language or voice to use when reading pages content. It impacts other pieces of CSS on some browsers, like hyphen placement and currencies, primarily for accessibility; it communicates the language of the content to screen readers.


Full page or screen language

Full page or screen language

Code the language attribute on the <html> tag or in your app properly.

Example: <html lang="en"> or <html lang="fr">

Code the language attribute on the <html> tag or in your app properly.

Example: <html lang="en"> or <html lang="fr">


Part of page or screen in a different language

Part of page or screen in a different language

Code the language attribute properly for any pieces of content in different languages.

If the language changes on the page (e.g. a French or a Pujabi language link), define the language for that content fragment:

 <a href=”#” lang=“fr”>français</a>

<a href=”#” lang=“pa”>Pujabi</a>

Code the language attribute properly for any pieces of content in different languages.

If the language changes on the page (e.g. a French or a Pujabi language link), define the language for that content fragment:

 <a href=”#” lang=“fr”>français</a>

<a href=”#” lang=“pa”>Pujabi</a>


Explore more

Explore more