HyperText Markup Language/Tag List/a
Use
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).
Example
<a href="http://en.wikibooks.org/" accesskey="w" hreflang="en" title="Click here for very good books">Wikibooks</a>
DTD
Strict, Transitional and Frameset, for both HTML 4 and XHTML 1.0.
a is an inline element.
Optional attributes
charset
This attribute allows you to specify the character encoding of the target location
coords
href
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.
hreflang
This attribute allows you to specify the language of the target page.
name
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.
rel
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.
rev
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.
shape
target
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.
type
This lets you specify the Multipurpose Internet Mail Extensions type of the targeted URL.
Notes
In Microsoft Internet Explorer, this is the only element on which the CSS pseudo-class selector hover works.