HTML-Lesson 11

Links

Types of Links

Web pages are nothing if you can't turn the page. In this lesson, you will learn how to include links to:

  1. Other pages on the web.
  2. Other pages on your web site, and
  3. Other places on the same web page.
  4. Use pictures to provide the links

Links to other pages on the web

Links to other pages goes like this:
<a href=" http://www.pagetutor.com/ " target="_blank"> Click here for another tutorial </a>

You should quote the new page url in full rather than starting with 'www'. Note the terminal '/' The 'target="_blank"' attribute will open page tutor in a second browser window. This enables the user to return to your page by switching off the second window rather than having to use the 'Back' button. The use of the attribute 'target' is now deprecated.

Links to other pages on your web site

The link tag to other pages goes like this:
<a href=" lesson02.htm "> Click to return to lesson 2 </a>

Links to other places on the same page

The destination has to be given a name e.g.:
<a name="top"></a>

This is now restricted to HTML. For XHTML use:
<a id="top"></a>

You can safely use both 'id' and 'name' as long as they are the same! E.G.
<a name="top" id="top"></a>

Now that the destination is tagged, here is the link:
<a href="#top">Click here to go to the top of the page.</a>
Note the inclusion of the '#' symbol. Leaving this out is an easy mistake.

Previous Lesson previous lesson next lesson Next Lesson