The Anchor Tag <A>...</A>.
This tag is the most fundamental of tags in relation to the success of the world wide web, because, without it you wouldn't be able to link to other pages and browseing would be a haphazard, unco-ordinated affair.
The basic tag <A HREF="some_page.htm">Some link text</A> produces a link like this Some link text to a page called "some_page.htm". The link destination is given in the form of a filename or complete URL and allows the browser to locate the destination object (usually another HTML document).
Although the complete URL can be used for any destination file, it is often easier just to give the filename and directory path if the destination file is in the same location as the source page. As most web servers are Unix based, the convention for the path is to use forward slashes instead of the normal PC backslash to separate directories.
Example:
Source file = C:\HTML\first_page.htm
Destination file = C:\HTML\second_page.htm
URL = "file:///c:/html/second_page.htm"
or "second_page.htm"
or "~/html/second_page.htm"
If the destination file is in a subdirectory of 'HTML' called 'PART1', then the filename would be given as "part1/second_page.htm".
Both text and images can be used as links, with text usually being displayed underlined and an image with a coloured border round it to signify a link. If an image is used, you should always specify an ALT value for the image, so that, should the viewer decide not to load your images, he/she can still tell what the link is, even if the image cannot be seen.
There are two other attributes which can be used instead of HREF...
NAME="[bookmark]" |
Used to specify a point in an HTML document to which another
link can send the viewer. |
TARGET="[frame label]" |
Used to identify the frame or window
in which the destination document is displayed. |