previous page main page next page

Hyperlinks

One of the most useful features of hypertext documents is the ability to use hyperlinks which connect to other documents. These documents could be on the same machine or they could be on a machine anywhere in the world but connected by the Internet. We're going to create another document for our restaurant project which is going to have the restaurant menu on it. You should already have created the file cafe.htm.
 

  • create a new document, edit it as below and then save it as menu.htm
     

<HTML>
<HEAD>
  <TITLE> menu </TITLE>
</HEAD>
<BODY>

<H1>Alice's Menu</H1>

</BODY>
</HTML>
 

Now open your cafe.htm file if it isn't already and add a line of code near the bottom so that it now looks like this:
 

<HTML>
<HEAD>
  <TITLE> restaurant </TITLE>
</HEAD>
<BODY>
<H1> Alice's Restaurant </H1>

<P>Alice Cooper lived in the Rockies in the middle of the last century and was one of the pioneering women of the region. She was respected, and sometimes feared, by those who knew her. Alice was hard working and determined to make something of her harsh surroundings. She didn't suffer fools gladly. The country at that time was just opening up and lawlessness was commonplace.</P>

<P>Alice made her home where two trails, both heading west, converged. Travellers from all parts came through the town as they headed towards the west coast in search of a new life. A railway was being built and would bring new trade. It was the perfect place to set up a new business. And so Alice's Restaurant was born...</P>

<P>Click <A HREF="menu.htm"> here </A> for a menu.</P>

<HR>

</BODY>
</HTML>
 

  • view cafe.htm with your browser
     


 

If you're familiar with browsing the web then you'll notice the clickable link at the bottom of the page, probably coloured blue. If you click it then the menu document should appear - not that there's anything on the menu apart from the title as yet!
 

  • click the 'back' button on your browser to return to the main page
     

You should notice that the link has changed colour; this indicates that you have 'visited' that link.

Let's put a 'return' link on the menu page now...
 

  • add a line near the bottom of the menu.htm page:
     

<HTML>
<HEAD>
  <TITLE> menu </TITLE>
</HEAD>
<BODY>

<H1>Alice's Menu</H1>

<P>Click <A HREF="cafe.htm"> here </A> to return to the main page.</P>

</BODY>
</HTML>
 

So you should now be able to navigate between the two pages...;-)
 

previous page main page next page © 1999 ePublish Scotland