The html code is the same whether you attach it to a piece of text or an image.

It starts with the tag a href= followed by the destination page within quotes.

The Path

The hardest part about learning to make links is stating the path. You can use either an absolute or a relative path, depending upon the location of the file and your own preferences.

Absolute path

Use this always when you are leaving your site, as in: Please go to google.

Relative path

This can only be used when you are linking to a page within your own site. For example, I could use this simple relative link, or even a more complex link to another directory that is still relative.

Links Within The Page

Links can be written to navigate within a same html page. The tag is the same (a href= ) but the destination is the number sign followed by the name of the destination id within quotes, i.e. "#construction".

<a href="#mylink"> or <a href="http://www.reifman.com/class/wwwtemp.html#isp">

The destination is pointed out by declaring an id:

<a id="construction"> </a>

Look at the document source on page How the web works for an example.


Images as Links

This works just like the text version of links. The one thing to look out for is that html automatically puts a border on an image that's a link unless you specify no border in the image tag or the style declaration.


                     The KingThe King with a border
These pictures of Elvis Presley can take you to an Elvis site, or this text can.

Tags have properties.

They are included within the tag and help to further define the function and behavior of the tag. For example, font tags can have many properties: size, family, etc. etc. So can the <A> or link tag. Some of the A tag properties include:

Links stand out because they are usually a different color and because the cursor changes as you roll over them. Having varied color text can confuse a user to thinking that the color means it's a link. But you can have fun with changing the colors of the links using the body tag or css. See the links in this paragraph look a bit different than the link below.

s y l l a b u s