Tags for this article: basics, html, hyperlink, linking, tutorial, url
As discussed earlier, Hyperlinks are those elements of HTML which makes it possible for us to navigate through different web pages or to different locations within a single web page. They are also used for adding e-mail support in the HTML document. In fact, hyperlinks act as the backbone of a website. As these links are used to fulfill different types of needs and demands, the way they are defined in the HTML document varies according to the circumstances. Every hyperlink needs an address to the location where the hyperlink is intended to redirect us. Technically speaking, each hyperlink needs a URL in order to point towards another location. External hyperlinks points towards a webpage of a different website on the same web server, whereas internal hyperlinks point towards a location on the same web page or to a different webpage of the same website. He structure can be more complex if a hyperlink is intended to point towards a web page of different website on the different web server. In each of the cases the way a URL is defined differs. It is very important to understand and learn the different ways to write the URLs because each type of URL changes the meaning of the hyperlink. The syntax of the URLs decided whether a hyperlink is internal, external or it is an e-mail link. Below are some examples of most common ways to write the URLs, each changing the intended meaning of the hyperlink.
1) <A NAME=”bottom”>Bottom</A>
<A HREF=”#bottom”>Go to bottom</A>
This is an internal hyperlink which is redirecting the user at the bottom of the same web page which he is currently viewing. To make this hyperlink an internal one, note the way the URL is written after the HREF attribute of anchor tag. There is no file name or path to a file name before the # sign. This makes the hyperlink an internal one.
2) <A HREF=”welcome.html#hi”>
This is an example of a hyperlink which redirects to a different document of the same folder. This means that both the linked documents are contained under the same parent folder.
3) <A HREF=”hello/welcome.html#hi”>
This is a hyperlink which points towards a different document residing in a different folder. But, in this case both the folders whose web documents are linked with each other are on the same web server.
4) <A HREF=”http://www.yahoo.com/good/hello/welcome.html#hi”>
The above example represents a hyperlink which is pointing towards a different web document which resides in a different folder on a different web server. This makes the hyperlink completely an external one.
5) <A HREF=”mailto://queries@content mantra.com”>
This type of URL consisting of ‘mailto:’ protocol indicated that the hyperlink is linked to a mail server.
So, the way URLs are used, changes the purpose and functioning of the hyperlinks. In fact, how much information you should include in the URL of a hyperlink depends upon where the hyperlink is redirecting the user i.e. where the linked resource is is located.