HTML | hreflang Attribute
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">
Example This Example illustrates the use of hreflang attribute in anchor element.
<!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> |
chevron_right
filter_none
Output:

Supported Browsers: The browser supported by hreflang Attribute are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- HTML | <a> hreflang Attribute
- HTML | <area> hreflang Attribute
- HTML | <link> hreflang Attribute
- HTML | DOM Link hreflang Property
- HTML | DOM Anchor hreflang Property
- HTML | <map> name Attribute
- HTML | rel attribute
- HTML | min Attribute
- HTML | low Attribute
- HTML | <img> alt Attribute
- HTML | name Attribute
- HTML | alt attribute
- HTML | for Attribute
- HTML | dir Attribute
- HTML src attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



