English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The hreflang attribute specifies the language of the text in the linked document, and this attribute is only used when the href attribute is set.
Here, the hreflang attribute indicates that the linked document is in English:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML <link> hreflang Attribute Usage-基础教程(oldtoolbag.com)</title> <link href="tag_link.php" rel="parent" rev="subsection" hreflang="en"> </head> <body> <p>3codebox.com example page.</p> <p>The hreflang attribute will not display any special content in any mainstream browser. However, it can be used by search engines or scripts./p> </body> </html>Test it out ‹/›
IEFirefoxOperaChromeSafari
Almost no mainstream browsers support the hreflang attribute. However, it can be used through search engines or scripts.
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.
None.
<link hreflang="langauge_code">
Value | Description |
---|---|
language_code | Language codes that are of double letters, specify the language of the linked document. To view all available language codes, please visit our Language Code Reference Manual. |