VOOZH about

URL: https://www.geeksforgeeks.org/html/html-hreflang-attribute/

⇱ HTML hreflang Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML hreflang Attribute

Last Updated : 11 Jul, 2025

HTML hreflang Attribute is used to specify the language for a linked document. It is used only when the href attribute is set. 

Syntax:

<element hreflang="language_code"> 

Attribute Value:

The hreflang attribute contains a single value language_code which is the two-letter language code and used to specify the language of the linked document e.i. en for English, hi for Hindi, etc.

HTML hreflang Attribute Supported Tags

Examples of HTML hreflang Attribute

Example 1: the This Example illustrates the use of hreflang attribute in anchor element.  

Output:

👁 HTML hreflang Attribute Example

Example 2: This Example illustrates the use of hreflang attribute in area element.  

Output:

👁 HTML hreflang Attribute Example
HTML hreflang Attribute Example Output


Supported Browsers:

The browser supported by hreflang Attribute are listed below:  

Comment
Article Tags: