Types Of Links

Types of links in HTML
 Types of links plays an important role if we are talking about html links.
  •  Internal Links--It represents a link to different webpage on the same website or different location on the same webpage.

  •   External Links-- It represents a link to different webpage on different websites.
  1. Links to different webpage in same website-When links are created to different webpages in the same website , relative URL's are used in HREF attribute of <a> tag.

These links are also called relative or intrasystem links.

If the source webpage and the destination webpage are in the same directory then you just need to specify the filename for HREF attribute.

For Example-

                              HTML CODING                                     WHEN RUNNING IN A BROWSER
      Types of links in HTML Types of links in HTML


     2.  Links within same webpage--You can also create links to another section or portion of the same webpage these links are also called intrapage links these links are userful-

  • When webpage is long and contains lot of subsections so that user can easily navigate around the same webpage to see the topic of internet without scrolling the page up and down.
  • It requires less time for creation and needs only a single trip to a server.
It involves following steps---
  1. Naming the webpage area:
         <a name="section1"></a>
Where, section1 is the name that describes the portion of the webpage. It may be headings or something logical. The bookmark acts as a destination for the link.

For Example-

    2. Creation of link: After the anchor name is created, select the text or image on HTML webpage that you want to turn into hyperlink that refers to area that you have named earlier.

<a href="#section1"> goto section1</a>

In the above case, the pound symbol(#) before name section1 is href attribute indicates that target is on the same webpage(internet)

When user clicks on goto section1,then contorl moves to the webpage area named section1

For Example:
<html>
<body>
<a name="top">
<a href="#down">goto bottom</a>
<br>
<br>
<br>

<br>
--------------------------------
<br><br><br>
<a href="#top">goto top</a>
<a name="down"></a>
</body>
</html>

   3.Links to webpages that are on different websites: We can also link to webpages that are external to our website. i.e. we can link a webpage to a different webpage that is not part of same website. Webpages belongs to different webpages can also linked.

For this we have to use absolute URL of the webpage in HREF attribute of <a> tag.

for example-

<a href="www.webdesigningtutoriall.blogpot.com">web designing</a>