by Vivienne Trulock
There are two main types of links
Absolute links are the links you generally make to other sites. They look
like this:
<A HREF=http://www.ilikecake.net>visit ilikecake's website</A>
or this
<a href="http://www.ilikecake.net">visit ilikecake's website</a>
<HTML>
<HEAD>
<TITLE>Absolute Links</TITLE>
</HEAD>
<BODY>
Try clicking your mouse on this nice link to go
to
<A HREF=http://www.ilikecake.net>visit ilikecake's website</A>
</BODY>
</HTML>
<html>
<head>
<title>Absolute Links</title>
</head>
<body>
Try clicking your mouse on this nice link to go
to
<a href="http://www.ilikecake.net">visit ilikecake's website</a>
</body>
</html>
Notice that in XHTML you must put quotation marks (") around the URL (website address), whereas in HTML this is not required.
Also notice that in XHTML the attributes must be in lower case.
Save and refresh in the browser. 'visit ilikecake's website' should be a blue underlined hyperlink. Try altering the link to any other address on the Web. Obviously, the external link won’t work unless you are online.
Relative links are the links you normally make to other pages on your site. They look like this:
<HTML>
<HEAD>
<TITLE>Relative Links</TITLE>
</HEAD>
<BODY>
<A HREF=mypage.htm>My First Page</A>
</BODY>
</HTML>
<html>
<head>
<title>Relative Links</title>
</head>
<body>
<a href="mypage.htm">My First Page</a>
</body>
</html>
The only difference is that there is no HTTP:// bit. The link assumes that mypage.htm is in the same folder as the page you are linking from.
<A HREF='morepages/mypage.htm'>My
First Page </A>
assumes that the page you are linking to is in a subfolder called 'morepages'
If you want to go up one level, you need to put in a ../ at the start of
the link
<A HREF='../mypage.htm'>My First Page
</A>
This assumes that you are in a subfolder already, and are linking to a page
in the level above you.
If you need to go back 2 levels, just put in 2 ../
<A HREF='../../mypage.htm'>My First
Page </A>
The next thing to learn is how to insert images.