hreflang
hreflang Attribute
The hreflang
attribute in HTML identifies the language and optional regional targeting of a linked document. It is primarily used within the <link>
element inside the <head>
section. This attribute assists search engines in recognizing the content's language and intended audience, enhancing search result accuracy based on user language and location.
Syntax
<a hreflang="language_code">
Values
language-code-country-code
: The first two characters denote the language of the linked page, while the last two (optional) specify the country.
Definition and Usage
- The
hreflang
attribute defines the language of the linked document. - It only functions when the
href
attribute is included.
Applies To
The hreflang
attribute can be used with the following HTML elements:
Example
<h1>The a hreflang attribute</h1>
<a href="https://institute.qarpeo.com" target="_blank" hreflang="en">Qarpeo</a>
Conclusion
The hreflang
attribute is crucial for directing users to the appropriate language version of a webpage. It enhances multilingual SEO by aiding search engines in recognizing language variations and regional targeting, improving accessibility and relevance for global attributes.
href
The href attribute in HTML defines the URL for a link, facilitating navigation between web pages, sections, or file downloads when using the <a> tag.
http-equiv
The http-equiv attribute in HTML allows a <meta> tag to convey HTTP header information, enabling the document to communicate settings to the browser.