Syntax of anchor names
  Posted On: 19-11-2008 344 Views

An anchor name is the value of either the name or id attribute when used in the context of anchors. Anchor names must observe the following rules:

  • Uniqueness: Anchor names must be unique within a document. Anchor names that differ only in case may not appear in the same document.
  • String matching: Comparisons between fragment identifiers and anchor names must be done by exact (case-sensitive) match.

Thus, the following example is correct with respect to string matching and must be considered a match by user agents:

<P><A href="#xxx">...</A>
...more document...
<P><A name="xxx">...</A>

ILLEGAL EXAMPLE:
The following example is illegal with respect to uniqueness since the two names are the same except for case:

<P><A name="xxx">...</A>
<P><A name="XXX">...</A>

Although the following excerpt is legal HTML, the behavior of the user agent is not defined; some user agents may (incorrectly) consider this a match and others may not.

<P><A href="#xxx">...</A>
...more document...
<P><A name="XXX">...</A>

Anchor names should be restricted to ASCII characters. Please consult the appendix for more information about non-ASCII characters in URI attribute values.

 
Add Your Comments
     
 Name  
 Email  
 Title  
 Comments  
 Validation Code   
Click here to Refresh
Specify the text displayed in the above validation code image. This text is case in-sensitive.
   
 
 Related Articles
There are no related article.
 
 
   
Home    Glossary    Favorites