O'Reilly logo

Dynamic HTML: The Definitive Reference by Danny Goodman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required