Now I'll show you how you got here from the previous page. Maybe you already know, but the
you clicked on to get here is called a link. More correctly, it is a hyperlink but who cares about that, right? Right!
I could have used a clever phrase like "Click here", but I used the graphic to illustrate a point (get it - illustrate? Hah! ):links do not have to be words; they can also be graphics or imagemaps For now, just to get you into links, we'll discuss using words and graphics as links. I'll tell you about imagemaps as links in the graphics page.
Some day.
The basic code to create a link is:
<A HREF="URL">link</A>
Pretty straightforward stuff, eh? Actually, it is: the tag itself is called an anchor tag. The URL is a web site address - it can be on your host computer or on a computer somewhere on the other side of the world. The link is whatever you want your viewer to click on to go to wherever you want them to go; as I said before, the link can be a word, a phrase, or a graphic.
If the target site (the thing you're linking to) is in your own directory you can use a relative address - that is, you don't need the full web address. For exmaple: our home page URL is
The full URL for the page you're looking at now is
but instead of coding the whole, loooooong URL in the link on the previous page, all I had to code was the last part.
The link you followed (the code, not the ) to get to this page is
<A HREF="tutorial_3.html"><IMG SRC="hand_right.gif"></A>
I could just as easily (though not as entertainingly) brought you here with the dull phrase click here by using the following HTML code for the link instead:
<A HREF="tutorial_3.html">Click here</A>
Nah...too dull.
Links can be used to navigate within the same document, or to move around on the same page in a document. This is done by using the name attribute of the anchor tag. This use of the anchor tag requires two parts - the source, or starting tag and the target, or destination, tag:
The source tag looks like a regular anchor tag except that the URL is replaced with an identifying name preceded by a pound sign (that little tic-tac-toe thing):
<A HREF="#name">link</A> - goes to a named point within the same document. If you click on this you'll go to the next topic and it will move to the top of the screen. Yes, that's silly, but it demonstrates this use of the "#name" attribute.
<A HREF="document#name">link</A> - goes to a named point in another document in the local directory. The local directory is the directory in which the current document resides. The local directory for the document you are reading now is http://www.oocities.org/Heartland/Meadows/7432/. Now, CLICK HERE...(clever, huh?)
<A HREF="URL#name">link</A> - goes to a named point in a target document in a foreign directory . A foreign dirctory is a directory other than that in which the source document is located.For this use of the <#name> attribute to work, however, the document to which you are linking must already have a target tag in it.
Oh, yeah - the target anchor tag! Couldn't be easier:
No matter where this tag appears, its format is always the same - always!
The "#name" attribute is very useful. Suppose you wrote a book online, or a document with multiple pages and multiple topics. You could use the name link to go from one page to another, or from a table of contents to the desired section of the text without having to page through everything in between.
Well, that's pretty much it for the anchor tag and the "#name" attribute. But before we move on, there are a few things to note here: