Name
<A> — NN all IE all HTML all
Synopsis
<A>...</A>
End Tag: Required
The
A
element is the rare element that can be an
anchor and/or a link, depending on the presence of the
NAME
and/or
HREF
attributes. As an anchor, the element defines a named location in a
document to which any URL can reference by appending a hashmark and
the anchor name to the document’s URI
(http://www.megacorp.com/contents#a-c). Names
are identifiers assigned to the NAME
attribute (or
in newer browsers, the ID
attribute). Content
defined solely as an anchor is not (by default) visually
differentiated from surrounding BODY
content.
By assigning a URI to the HREF
attribute, the
element becomes the source of a hypertext link. Activating the link
generally navigates to the URI assigned to the
HREF
attribute (or it may load other media into a
plugin without changing the page). Links typically have a distinctive
appearance in the browser, such as an underline beneath text (or
border around an object) and a color other than the current content
color. Separate colors can be assigned to links for three states: an
unvisited link, a link being activated by the user, and a previously
visited link (the linked document is currently in the browser cache).
An A
element can be both an anchor and a link if,
in the least, both the NAME
(or
ID
) and HREF
attributes have
values assigned to them.
Example
<A NAME="anchor3">Just an anchor named "anchor3."</A> <A HREF="#anchor3">A link to navigate to "anchor3" in the same document.</A> ...
Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.