HTML hreflang Attribute

The hreflang attribute specifies the language of the linked document."

Definition and Usage

The hreflang attribute specifies the language of the linked document.

Note: This attribute is purely advisory.

Applies to

The hreflang attribute can be used on the following elements:

Elements Attribute
<a> hreflang
<area> hreflang
<link> hreflang

Examples

A Example

The hreflang attribute specifies the language of the document in the link:

<a href="https://w3resource.net" hreflang="en">w3resource</a>

Area Example

An image map, with clickable areas:

<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">

<map name="planetmap">
  <area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm" hreflang="en">
</map>

Link Example

Here, the hreflang attribute indicates that the linked document is in English:

<link href="tag_link" rel="parent" rev="subsection" hreflang="en">

Browser Support

The hreflang attribute has the following browser support for each element:

Element
a Yes Yes Yes Yes Yes
area Yes Yes Yes Yes Yes
link Yes Yes Yes Yes Yes