web analytics

What are the various types of linking or anchor tags?

Types of Linking or Construction of Link Anchors

Link anchors are the glue that holds the web together. Link can be made to documents in the same folder, in different folder and on the web. They are described below.

Suggested Reading:

  1. What is URL? What are the types of URL? Describe them.
  2. What is web directories? Describe.

(i) Linking to Documents In The Same Folder:

The basic link connects one document to another file in the same folder. The given figure shows two HTML documents in the same folder.

 
To create a link from DocumentA.html to DocumentB.html, user will include the anchor tag <A>, the HREF attribute and a URL that points to the file name of the DocumentB.html. In this case, the link from the originating document might looks like this,
<A HREF=”DocumentB.html”>Link Text Goes Here</A>
So, when linking to documents within the same folder user needs to include only the file name.

(ii) Linking to Document In a Different Folder:

In the given figure there are files in separate folders. To create a link from Aboutus.html to consulting.html, user needs to include an URL that contains two pieces of information;

  1. A folder name, which specifies the folder on the server.
  2. A file name and extension, which specifies the exact file to display.
In this case the link might looks like this.

<A HREF=”folder02/consulting.html”>Link Text</A>
Here the folder name and the file name are separated by a forward slash (/) which indicates the end of the folder name and the beginning of the file name.

(iii) Linking to Documents On The Web

When linking one document to another on the web, the document might reside on different servers. The given figure shows an originating document with a link to a document on the web.

 
To create a link to doc03.html in the folder01of the www.server02.org server, we need to include the following information,

  1. The protocol indicator, which specifies how the server and browser communicate.
  2. The hostname, which tells the browser the name of the server that holds the information.
  3. The folder name, if necessary, which specifies the folder on the server.
  4. The file name, if necessary, which specifies the exact file to display.
So, the URL will look like this,

http://www.server02.org/folder01/doc03.html


and the full link text would look like this,

<A HREF=”http://www.server02.org/folder01/doc03.html”>Last try</A>


Suggested Reading:
  1. What is URL? What are the types of URL? Describe them.
  2. What is web directories? Describe.
Thank you. Take a moment to share 🙏