Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

Linking to another page on your site

If you have more than one page on your Intranet, you’ll want to create links between them. To create the link, use the <a> tag and type the name of the destination page and the text that forms the link. For example:

<a href="sales.htm">Sales brochure</a>

In this example, the destination page is sales.htm. You click on the text Sales brochure to jump to the destination. The text appears underlined or in a different colour, usually blue. You should include the double quotation marks round the destination page.

Try not to make the link text to long. If the text is part of a sentence, only use the most relevant text as the link. Don't use terms such as Click here as links; use a piece of your existing text.

If you want, you could use a graphic instead of text for the link. For more details about how to do this, see Making an picture a link.

To link to documents in other directories

You can link to documents in other directories; simply specify the relative path from the current page to the destination page. For example, to jump to a page sales.htm in a sub-directory sales:

<a href="sales/sales.htm">Sales brochure</a>

You should include the double quotation marks round the destination page.

Pathnames use the standard UNIX syntax. (Note: The UNIX syntax “..” stands for the parent directory. Remember, UNIX is case sensitive so sales.htm and SALES.HTM are different files.

You can also use the absolute pathname (the complete URL of the file) but relative links are more efficient, make it easier to move groups of pages to another location because the relative path is still valid, and give you less to type.

Use absolute pathnames if you link to documents that are not related, for example, someone else’s pages on the same server.

If you want, you could use a graphic instead of text for the link. For more details about how to do this, see Making a picture a link.