Home Tutorial Html Html5 Anchor tag attributes in HTML5, Define the href attribute of anchor tag.

 
 

Anchor tag attributes in HTML5, Define the href attribute of anchor tag.
Posted on: August 31, 2010 at 12:00 AM
Advertisement
In this section, we will see how to use href attribute in anchor tag.

Anchor tag attributes in HTML5, Define the href attribute of anchor tag.

In this tutorial, we will see the use of href attribute of anchor tag . The href attribute of anchor tag holds URL of destination document, which we want to visit. URL is a address of required file or document.
If href attribute is not available in anchor tag, it works as a placeholder of  hyperlink.

href Attribute :
Attribute Value Description
href URL
(Address of destination document)
 Define the address of required file.
      Absolute Address(URL)-: another site.
       Relative Address(URL)-: within site.


Declaration Syntax :

Declaration syntax of href attribute in anchor tag.

                           <a href="url">Text Area</a>

Example Of href attribute of anchor tag:

Code:

hrefAttributeTag.html

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<b>Example of anchor tag href attribute.</b><ul>
<li>
<a href="http://www.roseindia.net/" hreflang="en">
Go to Rose India site.</a></li>

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

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

Download this code

Advertisement

Related Tags for Anchor tag attributes in HTML5, Define the href attribute of anchor tag.:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: August 31, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com