Links
to another part of the page
To
make a link to another part of a page you will first need to add an <A
NAME="name"> tag next to where you want the link to jump to. Next you
need to put the link in, to do this you need to use the <A HREF="#name">
tag. See Example below:
Links
are what the Internet and HTML are all about. They allow you to link to
any file on any connected computer as long as you know the URL and have
the access rights. In this lesson we will firstly look at adding links
to other pages and then to other Internet address. The inclusion of graphics,
sound, text and embedded objects will finish of the lesson.
Linking
to other pages in the same directory
The
following tag will allow you to place a link to another page. <A HREF="TheNameOfYourFile.HTML">
Description text that will be linked</A>
To
create this link back to the first section the
code required is like so.
To
create this link back to the <A HREF="html1.htm">first section</A>
the code required is like so.
Linking
to other pages in deeper directories.
To
link to a file in another directory you need to specify the directory
add a forward slash and then add the file name. This is very similar to
the PC DOS. <A HREF="TheDirectory/TheNameOfYourFile.HTML">Description
text that will be linked</A>
Linking
to other pages in higher directories.
To
link to a file in a higher directory you need to add two full stops and
a forward slash before the . The two full stops and forward slash will
take you up one directory.
<A
HREF="../TheNameOfYourFile.HTML">Description text that will be linked</A>
Linking
to other URL's.
Linking
to other URL's is simple and very similar to linking with other files.
Type the URL between the quotes of the HREF just as you would if you were
using a browser. This also works for FTP addresses.
<A
HREF="http://home.netscape.com">The World according to Netscape</A>
Email
Links
You
often see people putting links into their pages that bring up a new Email
form with the address already filled in. <A HREF="mailto:user@host</A>
Anchor
Links
Anchor
links are links to certain parts of a page. For example clicking
here will take you back to the top of the page. <A HREF="#anchorname">words
to link</A>
You
will have to put an anchor in first before you can go anywhere. Add the
following code to where you want the link. This may be a link to a title
or picture, the choice is up to you.
<A
NAME="anchorname"></A>
It
is possible to link to a anchor on another page as well. You link as in
if you were calling up another page but add #TheAnchorName. For example,
to go to the bottom of lesson 2 click here.
The code to make that link was: <A HREF="html2.htm#bottom">click
here</A>
With
this at the bottom of the lesson 2 page. <A NAME="bottom"></A>
Putting
Links into New Browsers
You
may want a link to be opened in a new browser window. Click
here to see this page in a new browser window. Use the TARGET option
like so. <A HREF="html5.htm" TARGET="_New">Text</A>
Links
in Frames
If
you are using frames and you want to be able to click
on a link in one frame and have a document load into another frame
you need to target the link.