Home Tutorial Html Html5 Hreflang Attribute, Use of hreflang attribute of anchor tag in HTML5.

 
 

Hreflang Attribute, Use of hreflang attribute of anchor tag in HTML5.
Posted on: August 31, 2010 at 12:00 AM
In this tutorial, you will see the use of hreflang attribute of anchor tag in HTML5.

Hreflang Attribute, Use of hreflang attribute of anchor tag in HTML5.

In this tutorial, we will see the use of hreflang attribute and how to implement. Hreflang gives the language of linked document. This attribute can be used when href attribute is available.

hreflang Attribute :
Attribute Value Description
hreflang  language_code (ISO code) Define the language of linked document. It is two latter ISO code of language.


Declaration Syntax :

Declaration syntax of hreflang attribute in anchor tag.

                           <a hreflang="language code">Text Area</a>

Example of hreflang attribute:

Code:

hrefLangAttribute.html

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<b>hreflang attribute of anchor tag in HTML5.</b>
<ul>

<li>
<a href="http://www.roseindia.net/" hreflang="en">
Language of specified document is english.</a></li>

</ul>
</body>
</html>
Output:

Note: See the browser compatible page for successfully rendering the program.

Download this code

Related Tags for Hreflang Attribute, Use of hreflang attribute of anchor tag in HTML5.:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.