HTML and CSS Reference
In-Depth Information
er tags places a label within a document. When that label is used in a
link to that document, it is the equivalent of telling the browser to goto
that label.
The value of the id or name attribute is a character string, enclosed in
quotation marks. The string must begin with a letter, followed by letters,
numbers, hyphens, underscores, colons, and periods. The value must be
a unique label, not reused in any other name or id attribute in the same
document, although it can be reused in different documents.
Here are some name and id examples:
<h2><a name="Pruning">Pruning Your Kumquat Tree</a></h2>
<h2 id="Pruning">Pruning Your Kumquat Tree</h2>
Notice that we set the anchor in a section header of a presumably large
document. It's a practice we encourage you to follow for all major sec-
tions of your work for easier reference and future smart processing,
such as automated extraction of topics.
The following link, when taken by the user:
<a href="growing_guide.html#Pruning">
jumps directly to the section of the document we named in the previous
examples.
Browsers don't display the contents of the anchor <a> tag with the name
or id attribute in any special way. Technically, you do not have to put
any document content within the <a> tag with the name attribute be-
cause it simply marks a location in the document. In practice, though,
some browsers ignore the tag unless some document contenta word or
phrase, even an imageis between the <a> and </a> tags. For this reason,
it's probably a good idea to have at least one displayable element in the
body of any <a> tag.
 
Search WWH ::




Custom Search