Total Page Views :- webs counters

What is Anchor Tag

Anchor Tag in HTML is used to create Hyperlink. It can be a Internal Link or External Link.
A hyperlink join a webpage with other webpages, and thus, a website is formed.

Create a Hyperlink.

How to write a hyperlink?

<! doctype html>
<html>
<head>
<title>HTML Link</title>
</head>
<body>
	<a href="#">Link</a>                                      	( Simple Link)
	
</body>
</html>

Hyperlink on a webpage

Link

Properties of an anchor tag

  1. Blue in color
  2. Underlined
  3. On mouseover, cursor changes to pointer.
  4. Onclick, it turns red, till mouse left cick is on
  5. After a click, it turns purple

Hypertext Reference ( href="")

href="" Attribute is used in an Anchor tag to specify the URL( Uniform Resource Location) of the page link to go. It can be a relative link, absolute link or an image.


Relative Link

A relative Link is used to link pages within same domain.

How to create a Relative link?

<! doctype html>
<html>
<head>
<title>HTML Link</title>
</head>
<body>
	
	 <a href="page.extension">Learn Web Designing Online</a>   	( Relative link)
	
</body>
</html>

Relative link on a webpage

Link

Absolute Link

An Absolute Link is used to link pages from their Absolute Path. for exp

<a href="http://www.domain.com">Link</a> is an Absolute Link as it contains domain name and page.

How to create a Absolute link?

<! doctype html>
<html>
<head>
<title>HTML Link</title>
</head>
<body>

	<a href="http://www.domain.com">Link</a>                                    ( Absolute Link) 
	<a href="http://www.facebook.com/thetechaltum">Join us on Facebook</a>      ( Our facebook page) 
</body>
</html>

Absolute link on a webpage

Link
Join us on Facebook


Target

A target attribute ( target="" ) is used to tell window where to open that particular link.
Various values of target

  1. _self ( By Default) Open the link in same window
  2. _blank Open the link in new window
  3. _parentOpen the link on frameset parent of current frame
  4. _topBreak all windows and open link in entire window
  5. name of frame( iframe or frame)Open the link on frame whose name is there

Various Targets Values

<! doctype html>
<html>
<head>
<title>HTML Link</title>
</head>
<body>		
		<iframe name="frame1" width="90%" height="200"></iframe>
		<a href="http://www.techaltum.com" target="_self">_self</a><br>
		<a href="http://www.techaltum.com" target="_blank">_blank</a><br>
		<a href="http://www.techaltum.com" target="_parent">_parent</a><br>
		<a href="http://www.techaltum.com" target="_top">_top</a><br>
		<a href="webdesigning.html" target="frame1">frame1</a><br>
</body>
</html>

Click on the link to see behavior of following target



_self
_blank
_parent
_top
frame1