Hyperlinks to other Web sites

The target file for your hyperlink to does not have to be on your web site. To link to a file on any other web site you need to specify the Uniform Resource Locator (URL) or Uniform Resource Identifier (URI) of the site and page. For the sake of simplicity, you can consider URL and URI to mean the same thing: a complete web page address.

The HTML code to create a hyperlink to this web site would be:

<a href="http://www.simplehtml.co.uk/index.html">Simple HTML</a>

Simple HTML

The URL above is an absolute URL because it includes all parts of the URL format (except the port number that is universally standard for HTML pages) - the protocol, server, path and document name.

Absolute URL

If you omit the document name like this the default file, in this case index.html, would be returned:

<a href="http://www.simplehtml.co.uk/">Simple HTML</a>

Simple HTML

It is a good idea to show the URL as text in a hyperlink that links to a page on another site. This is especially useful if the web page is printed out so that you can read the URL to type it manually later, the code looks like this:

<a href="http://www.simplehtml.co.uk/">http://www.simplehtml.co.uk/</a>