A

The HTML element is used to create links, called hyperlinks or anchors, to other resources on the internet. Examples of such resources are other webpages, e-mail addresses, downloadable files, etc. This is done using the  attribute, which indicates the link's destination in the form of it's URI.

Example of a hyperlink:

In HTML 5, this is the only possible use of the element. In HTML 4 and below, it is one of two possible uses. The other function is to mark a position (know as fragment) in a document that another hyperlink can point to, using a so-called fragment identifier. This way, the element becomes the destination of a hyperlink. This is done using the  attribute. One element can be both a source and destination, by having both a   and a   attribute. The destination functionality has been replaced by using the generic attribute  on any HTML element.

Example of such use:

By default, links will appear as follows in all browsers:


 * An unvisited link is underlined and colored blue (ex. HTML & CSS Wiki)
 * A visited link is underlined and colored purple (ex. HTML & CSS Wiki)
 * An active link is underlined and colored red (ex. HTML & CSS Wiki)

Attributes
HTML example:

This element can also be used to link to an email address which the user can click on to send messages. Here is an example:

To link to an email on Wikia wikis, it is the same as linking to an external source:

That makes this: [mailto:community@wikia.com] which will allow you to send a message to Wikia staff when you click on it.

Rendering
Most graphical web browsers render links in blue with an underline, and the mouse pointer changes to a hand cursor while hovering over it. Visited links are colored purple, and active ones are red. Focused anchors show a dotted outline in the same color as the link text.

Most browsers have settings that allow the user to modify the default colors and underlining, and possibly even block these from being modified by the website.

Link colors can also be modified using the (deprecated) attributes (for general links),  (for active links) and  (for visited links) of the  element.

Named links (destinations) are not rendered differently from normal text.

Notable exceptions
Mobile Safari:
 * Focus and hover are not supported.
 * Active links are not colored, but have a semi-transparent black background.

Mobile Chrome:
 * Hover is not supported.
 * Focused elements get an orange outline with rounded corners.
 * Active links are not colored, but have a semi-transparent orange background.

Opera Mini:
 * Hyperlinks are not underlined.
 * Visited links are dark blue (#000070).
 * Focused links have a blue outline and a semi-transparent blue background.
 * Active links show a less-transparent blue background.

Gmail mobile web interface:
 * All hyperlinks are converted to plain text.
 * Instead, plain text URL's are converted to hyperlinks.

Example HTML source:

Gmail's mobile web interface will convert this to:

Conclusions

 * Hover, focus and active states are not available on all devices. Do not depend on them to supply vital information. For example, not all users can view a link destination by hovering over the link.
 * When sending emails, always include full URLs of hyperlinks in the text.

Coding rules
The element belongs to the Flow content category.