HTML <link> hreflangAttribute
Examples
Here, the hreflang attribute simply indicates that the linked document is written in English:
<link href="tag-link.html" rel="parent" rev="subsection" hreflang="en">
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
Almost no major browsers support the hreflang attribute. However, it can be used by search engines or in scripts.
Definition and Usage
The hreflang attribute specifies the language of the text in the linked document.
The hreflang attribute can only be used when the href attribute is set.
Note:This attribute is purely advisory.
Differences between HTML 4.01 and HTML5
None.
Syntax
<link hreflang="langauge_code">
Attribute Values
| Value | Description |
|---|---|
| language_code | The value is a two-letter language code that specifies the language of the linked document. To view all available language codes, visit ourLanguage Code Reference Manual。 |
HTML <link> Tag Other Extensions