Skip to content
Related Articles

Related Articles

Improve Article

HTML | hreflang Attribute

  • Last Updated : 03 Jul, 2021

The 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"> 

Applicable

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

  • <a>
  • <area>
  • <link>

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

html




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML hreflang Attribute
    </title>
</head>
 
<body>
    <center>
        <h1>
        GeeksForGeeks
    </h1>
 
        <h2>
        HTML <a> hreflang Attribute
    </h2>
 
         
<p>Welcome to
            <a href=
            id="GFG"
            rel="nofollow"
            hreflang="en-us"
            target="_self">
                GeeksforGeeks
            </a>
        </p>
  
    </center>
</body>
 
</html>

Output: 



Supported Browsers: The browser supported by hreflang Attribute are listed below: 
 

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

 




My Personal Notes arrow_drop_up
Recommended Articles
Page :