Basic Web Design Tutorial Part 4

Linking pages to each other

The web is called the web because pages link to each other. Make links clear and obvious in your page. Here’s how to make a link:

<html>
<body>
<h1>Example 4</h1>
Take me to <a href=”example5.html”>Example 5</a>
</body>
</html>

Example 4 (opens in a new browser window)

<html>
<body>
<h1>Example 5</h1>
Take me to <a href=”example4.html”>Example 4</a>
</body>
</html>

Example 5 (opens in a new browser window)

The “A” in the link stands for anchor. “HREF” is the destination. If an HTML file can refer to another page in several ways (this is important, it applies to IMG tags as well):

  • “anotherpage.html” – this file will be looked for in the same directory as the page the link is in.
  • “anotherdirectory/anotherpage.html” – looks in the directory “anotherdirectory” for the file “anotherpage.html”.
  • “http://www.anotherserver.com/anotherdirectory/anotherpage.html” – you get the idea?
  • “../anotherpage.html” – looks in the directory above the current page.
  • “anotherpage.html?search=frogs” – If a question mark appears in the URL then everything afterwards is data being sent to the page. You can see this when you search on google.
Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

Leave a Comment