|
Lesson 7 � Linking to other pages
So far we have concentrated on just one page, but the fun
starts when you start connecting lots of pages together to make
a whole Website - and then join your website to other peoples.
To do this you need to add links to join the pages together. When
someone clicks a link - either words or a picture - the link tells
the browser to fetch the details of another web page. A link is
usually underlined in blue text and you can tell when your mouse
is over one because the pointer will change to a hand shape.
Anchors
The <A> tag is called an anchor and is used to make a "Hypertext
REFerence" or HREF. The link is either the name of a local
file or the full URL of another web page.
So if you create another page for the fictitious football club,
it might be called "results.htm", so a link to it would
be
<A HREF="results.htm">Our Results</A>
A link to another web site might be
<A HREF="http://www.comedycircus.com">Jokes</A>
You can also link from pictures, so you might have something like:
<A HREF="http://www.comedycircus.com"><IMG
SRC="joker.gif ALT="Visit Comedycircus"></A>
More windows
The other thing you can do with a link is to tell the browser to
open the new page in a new window. This can useful if you are linking
outside your own site. This will leave your page visible so they
don't forget about you.
To do this add "TARGET=_blank to your link
<A HREF="http://www.comedycircus.com" TARGET=_blank>Jokes</A>
Link Colours
The links in a page are shown in a different colour from the rest
of the text and they are underlined.
There are three link colours: the colour for a link that hasn't
been visited, the colour of an active link (the colour it goes when
you move your mouse over it and click, before you let go of the
mouse button) and the colour of link you have already visited.
You can set the colours of these but the default colours are
Blue for unvisited
red for active
purple for visited
The colours might not be suitable for your pages - for example
if you background is blue then blue links will not show up.
The colours can be set in the <BODY> tag:
<BODY LINK=YOURCOLOUR ALINK=YOURCOLOUR VLINK=YOURCOLOUR>
Summary
You should now have some code that looks a bit like this:
<HTML>
<HEAD>
<TITLE>Surrey United: The Greatest Football Team Ever</TITLE>
</HEAD>
<BODY BGCOLOR=AQUA TEXT=BLACK LINK=RED ALINK=NAVY VLINK=MAROON>
<H1 ALIGN=CENTER><FONT COLOR=BLUE>The Surrey United
Home Page</FONT></H1>
<P>This is all about Surrey United, my favourite football
team.
<BR>
I have been a supporter for three years and they play at a ground
near my home so I can go and watch them</P>
<HR SIZE=4 ALIGN=CENTER WIDTH=50%>
<P>This is a <B>very important</B> season for
us. If we are not <I>careful</I> we could be relegated.
<BR>
That�s right <I><U>sent down</U></I>!</P>
<P></P>
<P>How are we doing this season? Check out <A HREF="results.htm">results</A>
page</P>
<IMG SRC="/gifs/misc4a.gif" WIDTH="48" HEIGHT="48" ALIGN="RIGHT"
alt="Big Cog">
<BR>
</BODY>
</HTML>
Looks like
The
Surrey United Home Page
This is all about Surrey United, my
favourite football team.
I have been a supporter for three years and they play at a
ground near my home so I can go and watch them
This is a very important season
for us. If we are not careful we could be relegated.
That�s right sent down!
How are we doing this season? Check
out our results
page
|
|