Although many people find the ability to add images and colors to their documents to be the principal appeal of web page authoring, the real magic of web documents lies in the ability of one document to take the reader to another document via hypertext links. This is the real fundamental concept that makes the Internet a World Wide Web of inter-linked pages.
The simple act of clicking a link can do something as mundane as providing a definition for a word or as exciting as taking you to experience another of our planet's myriad cultures.
To create a link, begin a hypertext anchor tag:
<a href=
add a destination address (URL):
"http://www.google.com/">
and an on-screen visible representation of the link (link text):
Search using Google.com
Then close the anchor tag:
</a>
The complete hypertext link in your HTML doc would look like this:
<a href="http://www.google.com/">Search using Google.com</a>
And on-screen, it would look and act like this:
Search using Google.com
One of the first uses of anchors was to take the document reader to another section of the current page being viewed. It's done in much the same way as shown above, with one exception; the destination is a "named" place on the current page.
Go to the place in your page where you wish to take the reader, and place an anchor:
<a name="downthepage"></a>
The hypertext link to that place is then:
<a href="#downthepage">Go down the page</a>
The pound-sign tells the browser to "stay on this page" and look for "downthepage".
For example, this link: Top takes you back to the top of this page.
| Hint: |
| Select "View source" in your browser menu to see how that was done. |
<< HTML Lists | Index | Images In HTML Documents >>