The <a> tag defines an anchor. An anchor can be used in two ways:

- To create a link to another document, by using the href attribute
- To create a bookmark inside a document, by using the name attribute

The <a> element is usually referred to as a link or a hyperlink.

The most important attribute of the <a> element is the href attribute, which indicates the link's destination.

Example Code:
Example of the <a href="" target="_blank">a tag</a>, used in html.
Example of the a tag, used in html.
Attribute Definition
href Specifies the location of a Web resource, thus defining a link between the current element (the source anchor) and the destination anchor defined by this attribute.
target Specifies the target frame to load the page into.

Possible Values:
  • _blank
  • _self
  • _top
  • _parent
rel Specifies the relationship from the current document to the anchor specified by the href attribute. Multiple values can be provided, separated by a space.

Possible Values:
  • alternate
  • author
  • bookmark
  • external
  • help
  • license
  • next
  • nofollow
  • noreferrer
  • prefetch
  • prev
  • search
  • tag
media Specifies what media/device the target URL is optimized for. Default value: all
hreflang Specifies the base language of the resource designated by href and may only be used when href is specified.
type Specifies the MIME type of the linked resource. Only to be used when the href attribute is present.
Global Attributes:

The <a> tag also supports the Global Attributes in HTML5

Event Attributes:

The <a> tag also supports the Event Attributes in HTML5

Last updated on 2 August 2018 By Rene Spronk

View All HTML Tags

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.