Help       |       Contact Us      

Back To Chebucto Community Net Homepage

Chebucto Community Net

Creating Links
Home >> HelpDesk >> HTML: The Language of the Internet >> Creating Links

Serving Your Community's Online Needs Since 1994.

Creating Links


What Are Links?

Hypertext links allow your page to point to other places on the Internet. When the link taken it will take the person to that place.

Back to Contents

Creating Links

To create hypertext links you must use the anchor tag, <a>. The anchor key is different from most tags because it is longer than most of the others. The full link is in the form of <a href="address">what you want to appear on the screen</a>. So if you wanted to create a link that went to the CCN Homepage your link would like this:

<a href="">Chebucto Community Net</a>

Where is the address for the Homepage and Chebucto Community Net is what will appear highlighted as a link on the user's screen.

Now the http:// tells the computer that this is a hypertext link (http stands for HyperText Transfer Protocol), which means that the location is on the World Wide Web.

Other types of links are:

file transfer protocol

Note that gopher is rarely used anymore, and ftp is being phased out by the web.

All of these would then have an address following them.

So a ftp link could be:

<a href="">Sunsite</a>

A gopher link could be: <a href="gopher://">Dal's Gopher Server</a>

Telnet can be very useful though. It allows you to log into another server on the Internet. So if you were at a university and had an account there you could still get back to CCN and log into your account by using:

<a href="telnet://">CCN</a>

Try this now:

Telnet to CCN

You could even use a friend's account to then log on to your CCN account and make changes to your files.

Back to Contents

Mailing Links

You could also create a link that sends an email message to someone. To do this you would create a mailto link:

<a href="mailto:email address">screen text</a>

Where you would put whatever email address you wanted into that spot.

Back to Contents

Relative Links

A useful thing with links is that you don't have to supply the whole address if the document is on the same site. If this is the case then you can just give the link relative to the page your on. So if in your public_html directory you had a hobbies directory that had a rock climbing site called rock.html then you could link this to your Homepage just by using the link:

<a href="hobbies/rock.html">Rock Climbing</a>

Instead of having to have the link:

<a href="">Rock Climbing</a>

(Note that not only is the second link much longer, it also slows down the system more when you follow that link)

The path for the directory above the directory you are in is ".." so if you were in the rock climbing page (in your hobbies directory) and wanted to make a link back to your Homepage you could just use the link:

<a href="../Profile.html">My Homepage</a>

Back to Contents

Named Anchors

In long documents such as this one it can be useful to have a table of contents at the beginning that allows the user to jump to different parts of the document. This is very similar to a hypertext link so it isn't much more difficult.

Normally when you set up a link <a href="document.html">Document</a> it takes you to the top of the document, but by using named areas it is possible make links to that document that go to specific parts, or to put a table of contents at the beginning of the document that lead to the different parts of the document.

In the document that has the section you need to use the anchor tag like this:

<a name="Section">Section Title</a>

You can make the section anything, but it is usually an abbreviation of the section title for convenience. The section title is what appears on the screen at the beginning of that section so you may want to format the link to add emphasis or to change the size of the title like this:

<h2><a name="zilla">Godzilla Movies</a><h2>

This way the title "Godzilla Movies" will appear emphasized.

Then to link to that spot you just have to add #section to the link to that document. So if the section "Godzilla Movies" was in a document called movies.html then the link would be:

<a href="movies.html#zilla">Godzilla Movies</a>

If there was a table of contents at the beginning of the movies.html document then the link could just be:

<a href="#zilla">Godzilla Movies</a>

To see more examples of this kind of link you can just hit \ (in lynx) to view the html of this document.

Use Chebucto's
Secure Webmail!

Chebucto Username

Mail Password

Set Spam Filter Preferences

Join Here!
Get your own Chebucto account

Chebucto Services
Look here for our available services and prices!
Accounts for individuals, families, non-profit groups and small businesses!

Secure Online Payment
for Donations/
Membership Renewals

About Us      Help promote us!
Who we are, what we do
and how you can help

Chebucto Plus
Our Premium Internet Access

Chebucto Wireless
Our Community-Run
Non-Profit Highspeed Access


The Chebucto

Websites of Dozens of Groups, Organizations and Businesses hosted by Chebucto

By Alphabet      By Subject

Chebucto Photo Gallery

Chebucto Community Net
Our Privacy Policy                Our Web Site Terms of Use