<A></A>

Anchor to create a hyperlink


[HOME] [PAGE UP] [NEXT PAGE]


Element used to define a hyperlink anchor (or this is how you link to other sites, pages or some point on this page or another page).


        <html>
        <head>
        <title>Some Title</title>
        </head>
        <body>
            .
            .
==>>    <A HREF="somepage.html">STUFF BETWEEN TAGS</A>
            .
            .
        </body>
        </html>

Everything I've read really makes this way too complicated so I'm going to try to make it simple enough for me to understand. In the example above, the text between the "A's" is going to appear highlighted or in a different color depending on the browser being used. When the viewer selects the text then the browser will load the page or site specified by the "HREF" address.

The address in the example will look for the file in the same location that the current page was taken from. If you want the viewer to be taken to another site then you would specify the address as "http://www.somewhere.com/somepage.html" or whatever it takes to get them there. If your page is in a subdirectory on the system where the current page is being viewed then you would specify the address as "./subdir/somepage.html".

Another form of the "A's" let's you mark a place on your page as somewhere you'd want the viewer to be able to jump to. Like when your page gets long and you want to make a little table of contents at the top so the user can go directly to a spot. Go to the spot you want to mark and do something like the following:


        <A NAME="somename1">Some Text</A>

The text "Some Text" won't be highlighted or anything. You won't be able to tell that it is a "target" for a link by looking at it. The name you assign to this spot MUST be unique for this page.

To use the reference that you've created, on the same page, you would do something like the following:


        <A HREF="#somename1">Some Text</A>

This creates a link to the spot you marked and when the viewer selects the text between the tags the browser will move to the marked spot on the page. If you wanted to create a link from another page to this target on this page then you would simply do it like:


        <A HREF="somepage.html#somename1">Some Text</A>

One last little trick you can do that's kind of neat - use an image in place of the text between the tags. Just be sure to use the "ALT" element with the image so you have something highlighted in case the viewer isn't loading images.

HTML 3.0 Draft
The new specification includes an "ID" tag for most of the elements which can be used instead of the "NAME" tag of this element to define linkable targets in a page.
Anchor specific attributes include MD.
MD
Specifies a message digest or cryptographic checksum that is used to validate the linked item you retrieve is in fact the item you expect it to be.
An example of this attribute in use is:
<A HREF="somepage.html" MD="md5:faV2O5+ddsuHKbd87UYjf/WecvFc">Another Page</A>
Attributes common to almost all of the tags permitted in the document body include ID, LANG and CLASS. You probably won't be using any of these tags for a while but I've included them so you know they are coming.
ID
A name to be used as a target for links or for naming particular elements in a style sheet. These take the place of the HTML 2.0 <A NAME="somename">Some Name</A> construct that defines internal document links.
LANG
An ISO standard language abbreviation that defines language specific elements to be used.
CLASS
Used to assign a class name to a tag.
An example of these attributes in use is:
<A HREF="somepage.html" ID="topicone" LANG="en-US" CLASS=section>Another Page</A>

Netscape

Nothing special.

Microsoft IE

Nothing special.

Internationalization

See HTML 3.0.


[HOME] [PAGE UP] [NEXT PAGE]


The Rusk Family . . . "the Legend Continues"

Michael T. Rusk
Comments to author: mrusk@radix.net

All contents copyright © 1996,1997 Michael T. Rusk
All rights reserved.

Revised: December 03, 1997 10:48 AM
URL: ./htmlgd/taga.html