Web Development HTML Guide - Learn HTML
Developer Tutorials
ASP
CGI & Perl
CSS
Flash
HTML
Java
JavaScript
Linux
MySQL
PHP
Photoshop
Python
Wireless
XML



Developer Manuals
Learn HTML
Learn PHP
Learn MySQL
Learn CSS
Learn Pear


Developer Scripts
ASP Scripts
ASP.NET Scripts
CGI & Perl Scripts
Flash Scripts
Java Scripts
JavaScript Scripts
PHP Scripts
Python Scripts
Remotely Hosted Scripts
Tools & Utilities Scripts
XML Scripts

Developer Resources
Developer Tools
Developer News
Developer Forums
Developer Content
Developer Book Reviews
Survey Software

Web Hosting Directory
Budget Web Hosting
ColdFusion Hosting
Dedicated Servers
Domain Hosting
E-Commerce Hosting
Email Hosting
Free Web Hosting
Linux Web Hosting
Managed Hosting
Reseller Hosting
Small Business Hosting
Windows Web Hosting

Attribute for <A ...>
NAME = "text string"

NAME gives the anchor a name. Other links target the anchor using that name. This allows you to link to specific places within the page.

For example, suppose you have a long page with a section about purchasing. You could create a named anchors in the sub-header for that section like this:

<H2><A NAME="purchasing">Purchasing</A></H2>

Note that the <A ...> tag goes inside the <H2 ...> tags. Unlike an anchor that uses HREF, a named anchor doesn't change the appearance of the text (unless you set styles for that anchor) or indicate in any way that there is anything special about the text. The purpose of the name is that another anchor can link to the named anchor.

To link to a named anchor, add a hash mark to the end of the URL of the page followed by the name. For example, to link to a section named purchasing within the page called anameexample.html we would create a link like this:

<A HREF="anameexample.html#purchasing">Purchasing</A>

which gives us this link:

Purchasing

If the link is to a named anchor in the same page then you don't need the file name of the page, just the hash mark and the name of the anchor. For example, you could put a set of links at the top of a long page that link to sections within the page. To link to the purchasing section in our example above you would put a link like this:

this code produces this
<A HREF="#purchasing">Purchasing</A>
the links at the top of this page

Don't forget the hash mark. That's the most common mistake made in this type of linking and has been a source of frustration for many webmasters. Remember these two rules:

The named anchor itself doesn't have a hash mark.
<A NAME="purchasing">
A link to the named anchor always has a hash mark.
<A HREF="#purchasing">


Copyright Idocs, Inc. Written by Miko Sullivan











About the NetVisits, Inc Network | Advertise
Developer Tutorials hosted by HostGator.
Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy.
Visit other NetVisits, Inc. sites: