HTML 5: The Markup Language

ahyperlink # T

The a element represents a hyperlink.

Content model #

a.elem.phrasing =
(normal-character-data & common.elem.phrasing*) & a.attrs
a.elem.flow =
(normal-character-data & common.elem.flow*) & a.attrs

Attribute model #

Element-specific attributes #

name = id
Specifies that its a element is a named hyperlink, with the name given by the value of this attribute.
href = uri
A URL that provides the destination of the hyperlink. If the href attribute is not specified, the element represents a placeholder hyperlink.
target = browsing-context-name-or-keyword
A name or keyword giving a browsing context for UAs to use when following the hyperlink.
rel = tokens
A list of tokens that specify the relationship between the document containing the hyperlink and the destination indicated by the hyperlink.
hreflang = langcode
The language of the destination of the hyperlink.
media = mediaquery
The media for which the destination of the hyperlink was designed.
type = mimetype
The MIME type of the destination of the hyperlink.
ping = uris
A list of URLs to notify if a user follows the hyperlink.

Assertions #

Tag omission #

An a element must have both a start tag and an end tag.

Permitted contexts #

Typical default display properties #

a:link, a:visited {
color: (internal value);
text-decoration: underline;
cursor: auto; }
a:link:active, a:visited:active {
color: (internal value); }

Details #

If the contents of an a element are empty, the element represents an empty hyperlink.