Link Relationships
HTML rel="alternate"
Identifies another representation of a document. For translated pages specify the target language; alternate stylesheets and feed discovery have different attributes. Do not use this as an automatic redirect. The example belongs in a document head; resource URLs are illustrative. Supply actual resources and server configuration to observe network behavior.
Formal Syntax & Structure
html syntaxhtml
<link rel="alternate" hreflang="fr" href="/fr/guide">Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| rel | space-separated relationship tokens | Include alternate on an element that supports this relationship. |
| href | URL or fragment | Identifies the linked destination or resource. |
| hreflang | language tag | Target document language when linking an alternate translation. |
Working Example
Example Snippethtml
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <title>Example</title> <link rel="alternate" hreflang="fr" href="/fr/guide"> </head> <body> <p>Example document</p> </body></html>