- Courses
- HTML
- HTML top level tags
- <link>
- Role of hreflang in link element
What is the significance of the hreflang
attribute in the <link>
element?
The hreflang
attribute indicates the language of the linked resource.
The hreflang
attribute in the <link>
element is used to specify the language of the linked resource. This is particularly useful for search engines and browsers to understand the language context of the resource, which can improve accessibility and search engine optimization by ensuring that users are directed to the correct language version of a resource.
<link rel="alternate" href="example-fr.html" hreflang="fr" />