HTML Cookbook Basic HTML Course

It's Easy!

Alternate version

Anchor Tag: Basic Links

This lesson is about making basic links with the anchor tag:
<a>...</a>

Most pages have links. It is a great way to make a web page interactive. Links make the web "the web".

Basic form with required attribute:
<a href="URL">...</a>

The URL is the web address of whatever it is you are linking to. It may be a file (a page, an image, a song), a newsgroup, or your email address.

The URL may be absolute (complete) or relative (short).

Replace ' ... ' with text or an image. This is what your viewers will click on to make the link work.

Text Link

<a href="http://www.gnu-bee.com/index1.shtml">
Midnight Midis
</a>

Image Link

<a href="http://www.gnu-bee.com/index1.shtml">
<img src="http://www.gnu-bee.com/logos/logo.gif" width="158" height="175" alt="Go ToMidnight Midis" />
</a>

Email Link

The URL starts with 'mailto:', then add your email address.

<a href="mailto:your_name@your_domain">
Email
</a>

Example, my email link is:
<a href="mailto:gnubee@webtv.net">
Email Gnubee
</a>

Newsgroup Link

The URL starts with news: then has the URL of the newsgroup.

<a href="news:URL_of_NG">
Name of NG
</a>
<a href="news:URL_of_NG">
<img src="newsgroup_banner.jpg" height="60" width="220" alt="newsgroup banner" />
</a>

Link to Html.Help.Gnubee

<a href="news:alt.discuss.clubs.public.html.help.gnubee">
HTML Help Gnubee
</a>

In Part 2, we learn how to make "internal" links.

Happy coding!
Gnubee

Links
Tips
Tools
References
Rules
HTML Help Gnubee - Newsgroup
HTML Course Contents (Home)

Valid XHTML 1.0!

Valid CSS!