Last modified on 7 October 2010, at 19:37

HyperText Markup Language/Tag List/a

UseEdit

The anchor element (a) is used to define achors, or hyperlinks. You can use it to refer to other pages with the href attribute (Hyperlink Reference).

ExampleEdit

<a href="http://en.wikibooks.org/" accesskey="w" hreflang="en" title="Click here for very good books">Wikibooks</a>

DTDEdit

Strict, Transitional and Frameset, for both HTML 4 and XHTML 1.0.

a is an inline element.

Optional attributesEdit

charsetEdit

This attribute allows you to specify the character encoding of the target location

coordsEdit

hrefEdit

With the href attribute you specify the destination of the hyperlink, in other words, the page a visitor will be sent to when he clicks the link.

hreflangEdit

This attribute allows you to specify the language of the target page.

nameEdit

This allows you to specify a name for the hyperlink, for use as a bookmark. Note that in XHTML, you should use the id attribute.

relEdit

Allows you to specify the relation of the current to the target page. In other words, what the target page is, Possible values are alternate, appendix, bookmark, chapter, contents, copyright, designates, glossary, help, index, next, prev, section, start, stylesheet and subsection.

revEdit

Allows you to specify the relation of the target page to the current page. In other words, what the current page is. This should be the same for all hyperlinks in the current page. For possible values, see rel above.

shapeEdit

targetEdit

This attribute can only be used in transitional and frameset XHTML documents. It is used to tell the browser where to open the targeted URL. The user has Four options to choose from:

  • _blank: The URL will open in a new window.
  • _parent: Will open in the parent frameset.
  • _self: Will open in the same window/tag as it was clicked on.
  • _top: Will open in the full body window.

typeEdit

This lets you specify the Multipurpose Internet Mail Extensions type of the targeted URL.

Standard attributesEdit

NotesEdit

In Microsoft Internet Explorer, this is the only element on which the CSS pseudo-class selector hover works.

More infoEdit

The <a> tag on W3Schools