html tutorial - hreflang Attribute in HTML - html5 - html code - html form

Hreflang attribute in html

Learn html - html tutorial - Hreflang attribute in html - html examples - html programs

  • The hreflang attribute used to specify language of linked resource.
  • The hreflang attribute is only used if the href attribute is present in the element.

Syntax for hreflang attribute in HTML:

<a hreflang="language_code">

Applies To:

Elements Attribute
<a> hreflang
<area> hreflang
<link> hreflang

hreflang Attribute Values:

Value Description
language_code A two-letter language code that specifies the language of the linked resource.

Sample Coding for hreflang Attribute in HTML:

Tryit<!DOCTYPE html>
        <title>Wikitechy hreflang attribute</title>
           <a hreflang="en" href="">Wikitechy</a>

Code Explanation for hreflang Attribute in HTML:

hreflang Attribute Code Explanation

  1. hreflang attribute used define the language of linked resource as English.

Output for hreflang Attribute in HTML:

hreflang Attribute Output

  1. The output shows that the “Wikitechy” Link specified in English which is not visible to user that will be used to search engine for regional search results.

Browser Support for hreflang Attribute in HTML:

Yes Yes Yes Yes Yes

Related Searches to hreflang Attribute in html