Make your own free website on Tripod.com

Anchors

Links are what put the HT in HTml and HTtp. - Hyper Text. Links allow you to get from one site to another by just clicking on the hyper text (usually underlined and blue)

The name of the anchor tag is <A>. There are two attributes (and a third when we get to frames) The first is HREF the other is NAME. We will deal with HREF 1st.


-=HREF


Full links

here's how to do a full link:
<A HREF="http://www.tripod.com/">Click here to go to Tripod</A>.

Gives

Click here to go to Tripod.

The <A> tag tells the browser it is an anchor, and the HREF attribute tells the browser where to go after the user clicks on the link. In a way, the HREF attribute isn't required, but the anchor won't do anything if it isn't there.


Relative Links

A relative link is different from a Full link by that a relative link links by where you are relative to the page you are linking to.

Example:
<P>Both of these links go to the same page!<BR><A HREF="http://members.tripod.com/~joke_file/joke_file.html"> Click here to go to the Joke file</A><BR> <A HREF="../joke_file.html">Click here to link to the joke File</A><BR>

Gives

Both of these links go to the same page!
Click here to go to the Joke file
Click here to link to the joke File

Relative links tend to be shorter than full links. To use them, you should have a good understanding of the UNIX Operating System's file system.

A ../ goes up one directory and ./ stays in the same directory. to go down a subdirectoy named sub3, ./sub3/file_name.html


mailto:

to have a "Mail me" link on your webpage, you can use the <A> tag.

example

<A HREF="mailto:xcougar@yahoo.com">Mail ME </A>!

does

Mail ME !

-=NAME

The NAME attribute allows you to link to different parts in a page. i've seen this used many times in FAQs. The author would use lists to state the different parts of the FAQ, and he'd put links in the lists to go to the various parts of the FAQ. The destination of such a link would be written:

<A NAME="spot1">Spot 1 </A>

gives:
Spot 1

TO now link to this spot from with in this document, you would type:

<A HREF="#spot1">Click here to go to Spot 1 </A>


does:


Click here to go to Spot 1

to link to this spot from another document:

<A HREF="ch1_7.html#spot1">SPOT 1</A>

does:
SPOT 1

The full link would be :<A href="http://members.tripod.com/~joke_file/html/ch1_7.html#spot1"> Go to Spot 1! <BR>DO not pass go, do not collect $200</A>

equals

Go to Spot 1!
DO not pass go, do not collect $200

last example:

<A HREF="http://members.tripod.com/~joke_file/joke_file.html#end">GO to the end of the joke file</A>

gives:

GO to the end of the joke file


NEXT | Table of contents