More Web Design Tutorials

Basic HTML – Creating a Hyperlink – Part 1

February 24, 2011

One really can’t create a website without hyperlinks – then it would be just a bunch of individual, separate pages. Might as well read (or write) a book …

A link can take you to another page in the same website, a page in a different website, or to another place on the same page (bookmark). The code for such a link is:

<a href="Address = URL">Address or Description - or an image</a>

So for example:

<a href="http://www.killersites.com">www.killersites.com</a>

or

<a href="http://www.killersites.com">A Great Place to Learn</a>

take you to the same place. If you see those 2 links on a page, the first one would look like this (Make sure to hit your browser’s back button after clicking the following links – this lesson isn’t over yet): www.killersites.com and the second one like that: A Great Place to Learn. But each takes you to the same place. I’m pointing that out to demonstrate that the description really is irrelevant – it’s just to give the cursor something to grab – what matters is the part following the ‘http’.

The above link takes us to a different website. But we can also link to a different page within the same site.

<a href="how-to-build-websites.com/basic-concepts/part1.php">A page on this site</a>

This would appear like this: A page on this site.

Note how there’s no ‘http’? The ‘http’, which stands for Hypertext Transfer Protocol, takes us way out into cyberspace, and from there, we can reach anything. But since this time, we only want another page inside this website, we don’t have to reach out that far, and the http isn’t needed.