
Basic HTML Tutorial: Linking Pages
Together
Home > Build
> Programming > HTML
> Basic
HTML Tutorial
2.6 Linking Pages Together
We have already discussed ways to point to URLs.
Now we're going to show you how to create a link, either within
your web site, or to another web site.
In order to link a document, the <A> tag
must be used. The <A> tag is somewhat similar to the
<IMG> tag, in that you have to define the source for
the link. The <A> tag is a container tag. First the
link has to be defined, and then the the content to activate
the link must be displayed. Everything between the <A>
tag and the </A> closing tag, will be sent to the URL
defined in the initial <A> tag. Since you understand
URLs, linking to them shouldn't be much of a problem. Here
is how you use the <A> tag:
<HTML>
<HEAD>
<TITLE>Linking to another page</TITLE>
</HEAD>
<BODY>
<A HREF="link.htm">Check out this page</A>
</BODY>
</HTML>
See
it in the Browser
In addition to text, you can use graphics to
link your pages. Here is an example of how the w3nation logo
could be used to link to the homepage. This is also an example
of linking to an external site, using an absolute url.
<HTML>
<HEAD>
<TITLE>Linking to another page</TITLE>
</HEAD>
<BODY>
<A HREF="http://www.w3nation.com"><IMG
SRC="../../../graphics/w3nation.gif></A>
</BODY>
</HTML>
See it in the
Browser