--- Hyperlinks ---
[ Previous Section | Home | Index | Test Your HTML | Related links | Next Section ]



If you have been building your web page while reading this tutorial, you should have a nice collection of lists and titles, and maybe some text explaining what your site is all about or about who you are. I bet though that you want to let your visitors go to some of your favorite webpages, or maybe allow them to go to another page, maybe that of your friend or family member. You can do all that by placing a few hyperlinks on your page. "Hyperlinks" are the clickable bits on a webpage. Typically blue and underlined text, hyperlinks can be placed on anything from pictures to image maps. Clicking on a hyperlink, as you know, will take you to another page, or to another section of a page. Below we will discuss three types of hyperlinks, those that link to other documents, those that link to another section in the same document, and those that link to another section of another document.



Linking to Another Page


<A HREF="http://a.web.address.here/pagename.html"> ... </a>

- This is the simplest way to link your page to another page on the web. The "a.web.address.here/pagename.html" is the location and name of another page on the World Wide Web. For example, to link to H.T.T.P. you put in your webpage this:

<A HREF="http://hyperion.advanced.org/~13947/index.html> H.T.T.P </a>


The part between the first tag and the end tag is the text that will make up the hyperlink; in this case "H.T.T.P" will be blued and underlined like this H.T.T.P.. You can also place the tag for an image in place of text to make the image a hyperlink to another site.



Linking to Another Section of the Same Page


<A NAME="top">
<A HREF="#top"> ... </a>


- This is both an example of how to do what is called an "internal reference" and an example of its most common use. Internal references are very useful for jumping up and down the page to important sections within the same document; this saves your visitor from having to scroll excessively. To make an internal reference, first place the first line of code, the <A NAME> anywhere in the document that you want people to jump to; in this case we could place it at the very top. Then, place the hyperlink anywhere in the document where it is most convenient for it to be; in most cases you would place it at the bottom, or, in a very long document, at some point in the middle.



Linking to Another Section of Another Page


<A HREF="http://a.web.address.here/pagename.html#section_name"> ... </a>

- You can even combine the two methods together to allow your visitor to jump to the middle of another page. All you would need to do is append the #section_name to the end of the address and filename, like this:

<A HREF="http://www.story.com/novella.html#chapter2>Novella: Chapter 2</a>




[ Previous Section | Home | Index | Test Your HTML | Related links | Next Section ]