HyperText Markup Language/Tag List/a
Use
editThe anchor element (a
) is used to define anchors, or hyperlinks. You can use it to refer to other pages with the href
attribute (Hyperlink Reference).
Example
edit<a href="http://en.wikibooks.org/" accesskey="w" hreflang="en" title="Click here for very good books">Wikibooks</a>
DTD
editStrict, Transitional and Frameset, for both HTML 4 and XHTML 1.0.
a
is an inline element.
Optional attributes
editcharset
editThis attribute allows you to specify the character encoding of the target location
coords
edithref
editWith 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
editThis attribute allows you to specify the language of the target page.
name
editThis 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
editAllows 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
editAllows 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
edittarget
editThis 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
editThis lets you specify the Multipurpose Internet Mail Extensions type of the targeted URL.
Standard attributes
editNotes
editIn Microsoft Internet Explorer, this is the only element on which the CSS pseudo-class selector hover
works.
More info
editThe <a> tag on W3Schools