Home Logo
Show Full Menu
Hide Full Menu
 

Understanding hyperlinks (links)

Created: 16/09/10 Views: 1195 myFave Image

In this tutorial we will learn how to include hyperlinks (links) into our web page.
Including hyperlinks into a web page is very simple, the first thing we need is the <a> </a> tag. This tag simply lets the browser know that it is now dealing with a hyperlink. Inside the <a> </a> tag there is 1 essential attribute, href.


The target attribute has 5 possible values; 99% of the time you will only use _self or _blank, however there may come a time when you feel another value best fits your needs.

Here are examples of <a> </a> tag coding
  • <!--This will open the homepage in a new window/tab-->
  • <a href="index.php" target="_blank">Link to Home Page</a>

  • <!--This will open the homepage in this window-->
  • <a href="index.php" target="_self">Link to Home Page</a>

As you can tell from the href attribute, the the location of the new web page is inserted, it is better practice to use the full URL for the web page, for example, http://www.theWebPage.com/about.html. Also between the <a> </a> tags is where the content of the link will go, so whatever is in between the tags is what shows as the hyperlink.

Here are the examples.
  • <!--This will open the homepage in a new window/tab-->
  • Link to Home Page

  • <!--This will open the homepage in this window [Click back to return to this tutorial]-->
  • Link to Home Page


next tutorial: Understanding images

There are no comments