English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Manual de Referência HTML

大全 de etiquetas HTML

Atributo hreflang do link HTML

O atributo hreflang especifica o idioma do texto do documento linkado, e é usado apenas quando o atributo href está configurado.

 HTML <link> tag

Exemplo Online

Aqui, o atributo hreflang indica que o documento linkado é em inglês:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Uso do atributo hreflang do link HTML-Aula Básica(oldtoolbag.com)</title>
<link href="tag_link.php" rel="parent" rev="subsection" hreflang="en">
</head>
<body>
<p>oldtoolbag.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 to see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Almost no mainstream browsers support the hreflang attribute. However, it can be used through search engines or 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.

HTML 4.01 With HTML5Differences

None.

Syntax

<link hreflang="langauge_code">

Attribute Value

ValueDescription
language_codeLanguage codes with double letters specify the language of the linked document.

To view all available language codes, please visit our Language Code Reference Manual.

 HTML <link> tag