general tips>
other tips>

Links: Managing and Modifying

The main tag you'll need to know when dealing with links looks like this:

<A HREF="link.html">link</A>

You'll notice that everything between the A tags is the link. The HREF="..." part is saying what the link is to. In this case, it would actually link to link.html in the same directory as the current document. This is what that code would actually do:


In this case, it won't actually work, because there IS no link.html in this same directory!

Another common task is to link to an external web page. This is relatively easy, but it is very import to include the entire address, including the http:// part. For example:

<A HREF="">UMD</A>

Would produce: UMD Simple, eh?

You can also make an image a link. One of the most important things about links is that everything between the A tags is the link. To include an image in a link, just put the IMAGE tag after the A HREF=" " tag. Like this:

<A HREF="images.html"> <IMAGE SRC="images/images.jpg"></A>

Which would look like this:

Notice that the image is outlined in a color, probably purple. This tells us that it is a link, and it also tells us that we've already visited it. (Since it's purple, and not blue.) To get rid of the outline, just add BORDER="0" in the IMAGE tag.

Now, I know one thing that I love to do is change the color of my links. There are two ways to do it. If you want all of your links on the page to have the same color, you do it up in the body tag. Let's see what the code for this would look like.

<BODY LINK="red" VLINK="green" ALINK="yellow">

What this would do is set the unvisited links to red, the visited links to green, and the ALINK part is the color of the link as you press down on it, which would of course be yellow in this case.

What if you wanted to change the color of just one link? To accomplish this, it's similar to just changing the font color, but it's important where you place the FONT tag. Let me show the difference:

<FONT COLOR="green"><A HREF="somewhere.html">somewhere</A></FONT> somewhere
<A HREF="somewhere.html"><FONT COLOR="green">somewhere</A></FONT> somewhere

See the difference? It's all in where the FONT tag goes. One interesting thing to point out is that the second link here will always be green. It won't look any different after it's been visited, or as you press down on it. There may be ways to modify this, too, but I'm not aware of it. Yet. ;-)

Another important link technique is to create internal links within a page. This can make rather long pages much more accessible. It's especially useful if you have a page with a lot of text in it. The way it works is you set up "targets" or "anchors" throughout the page. These will be places that the links will be sent to. The code for these is:

<A NAME="target_name">target text</A>

Notice that the A tag is around the text. This is not necessary, but it can help decrease some errors. If you don't have anything between the A tags, it may confuse some browsers. Now, to reference this target, or to send a link there, we simply make a link to the current page, and then add #target_name after it. Like this:

<A HREF="page.html#target_name">text</A>

When a view clicks on this link, it sends them to wherever "target_name" is in your page. Slick, huh?

Well, that's all I've got here for links. There's a lot more, but this is plenty to get started.