Links are being used frequently in text, as we see in Wikipedia and in other top websites. Actually when you click over the hyper text you jump into another section. The text or part of text is hyper linked when it requires more explanation about itself. When you move the mouse over a link, the mouse arrow will turn into a little hand.
<a> tag and its attributes are used to create hyper link in your webpage
Link Attributes:
As we know well that attributes defines the properties of link,
href= ” “:
It determines the document’s path means which file is to be open when someone click on it.
Target= ” “:
Targets specifies where to open the linked file. Following are some values that are given to target attributes
_blank:
When you put the word “_blank” your linked file or document will be open in new window or tab.
_self:
When you put the word “_self” your linked file or document will be open in same window.
_parent:
When you put the word “_parent” your linked file or document will be open in parent frame.
_top:
When you put the word “_topf” your linked file or document will be open in fully covering your window.
_framename:
When you put the word “_framename” your linked file or document will be open in your specified frame.
Try following example to understand basic difference in few options given for target attribute
Example Code:
<html> <head> <title>Hyperlink Example</title> </head> <body> <p>Click any of the following links</p> <a href="http://www.google.com " target="_blank">Opens in New</a> <br> <a href=" http://www.facebook.com " target="_self">Opens in Self</a> <br> <a href=" http://www.google.com " target="_parent">Opens in Parent</a> <br> <a href=" http://www.w3schools.com.com " target="_top">Opens in Body</a> </body> </html>
Types of Links:
There are some types of links that are used most of the time are as under
Local Link:
Hyper text is linked to the same server or directory
<a href=”mypage.html” target=”_blank”> my page </a>
Internal Link:
Hyper text is linked to the same page, actually an internal link is needed when we have a big post and we want to jump from certain point to any other specific portion.
- First of all we assign a name to targeted part that is to be shown when someone click on hyper text.
<a name=”top”> </a>
- Secondly we use link tag to call by its name.
<a href=”#top”>Goes from here</a>
External Link
In external linking you link your hyper to any other place as out of your webpage or website, for example you want to link your hyper text to any other server.
<a href=”http://facebok.com” target=”_blank”>Facebook</a>
Download Links:
Download link is used when you want to present a file for your visitors that they could be able to download your file easily.
Internal Download Link:
It is used when you have a complete file in your own website, so it means visitors download from your storage.
<html> <head> <title>Download file</title> </head> <body> <a href="applicationform.pdf"> Download Application </a> </body> </html>
External Download Link:
It is used when you have not a complete file in your own website, so it means visitors download from any other storage but using your path.
<a href=”http://onlinetuting.com/applicationform.pdf”> Download Application Form </a>
E-Mail Link:
E-Mail link is used to send email to specific person, in websites people may be able to send E-mails to CEOs. Simply when you have a website you should create a content form where people connect you by E-Mail.
<html> <head> <title>Sending Email</title> </head> <body> <a href= "mailto:pakistanpopular@gmail.com">Send Email</a> </body> </html>
If you have question about link building put in under comment section thanks