Virtual Mechanics
Click here for a free WYSIWYG pixel precision HTML editor.
For the best in D HTML editors
Archive by Date
Archive by Topic

Anchors Away

Several weeks ago I described how to use the Anchor Tag to create a
link to another web page. Did you know that the anchor tag can also
be used to link to another location on the same web page or to send
an email to someone? These versatile capabilities are an ideal and
simple way to add a bit of professionalism to your web page or to
gather messages from your visitors.

The normal format for the Anchor tag is: <a
href=http://www.aurl.com>click here</a> where www.aurl.com is
the URL address of a page you want to link to when a visitor presses
the "click here" text. To use this tag to send an email, replace the
URL "http://www.aurl.com" with the email address that you wish to
send the message to. You must also proceed the email address with
the "mailto:" keyword. The format to send an email to this list
address would consequently be <a
href="mailto:tips@VirtualMechanics.com">Contact IMS Web
Tips</a>. When your visitor presses the highlighted text, it will
display their email program with the web tips address already
included. All they have to do is add the subject and message and
then press the send button.

You can also automatically add the subject to the message by
appending "?Subject=Subscribe" (where "subscribe" can be any
subject). If you wish to write the contents you can append
"?Body=message" (where message is the "contents" of the email).
To compose the entire email for the visitor try this format using the
ampersand "&" to concatenate mailto options:

=Thanks&Cc=news@VirtualMechanics.com>Subscribe Here</a>


Space characters in the Subject or Body may cause problems. Use
the escape sequence "%20" without the quotes to add spaces.

If you have a large web page you may wish to create a link to a topic
or location on the page using a local anchor. This can be done by
naming your anchor and then creating a link to it using the special
pound "#" positioning symbol. The format for a named anchor is:
<a name=topic1>topic1</a>. You can position this tag anyplace on
your page you like. To create a local link, enter the anchor tag:
<a href="#topic1">Go to topic 1</a>.

If you create a list of topics at the top of your page, clicking this link
will take the visitor to the location of the "topic1" anchor. To create
a link to the topic from any other page you would simply use the full
URL of the page with the "#topic1" local URL appended to it.
<a href="http://www.webpage.com#topic1">Go to topic 1</a>.

A great place to use these types of anchors would be in long multi-
topic articles posted on a web page such as a Newsletter. IMS Web
Tips of course would be a prime candidate and as such, we will start
adding links to each topic. Here are last week's topics.

Introduction to Forms http://www.IMSWebTips.com/issue11.htm#topic1
Link Exchanges http://www.IMSWebTips.com/issue11.htm#topic2
IMS Web Dwarf http://www.IMSWebTips.com/issue11.htm#topic3
Timed Links http://www.IMSWebTips.com/issue11.htm#topic4
Next Week http://www.IMSWebTips.com/issue11.htm#topic5

As a final note, I have experienced problems opening my Mail
Program using 'mailto:' when not using my default browser. I have
also been told that there may be a problem using 'mailto:' if you are
an AOL user. Please feel free to let me know if you have had any
problems using a 'mailto:' link.

"IMS Web Tips" ISSN 1488-7088
© Copyright 1999 Virtual Mechanics

"IMS Web Tips" is a weekly news letter for all web site managers regardless of experience who are looking for detailed information on
creating, maintaining and promoting their web sites.

To subscribe send an email to tips@imswebtips.com with SUBSCRIBE
as your subject or visit the IMS Web Tips home page for subscription information and a list of past articles.
IMS WebTips