Export to GitHub

doctype-mirror - AElement.wiki


You are here: Home > HTML Reference > Elements > a element

EspaƱol

If the <a> element has an href attribute, then it represents a hyperlink.

If the <a> element has a name attribute, it serves as an anchor, so that a hyperlink can lead to a specific place in a html page.

The target attribute specifies if the link will open in the same window, or a new one. If frames are used, those can be the target too.

SVG also defines its own <a> element which has a similar purpose.

Usage

<a href="/">home</a> <a name="navbar"></a> <a href="#navbar">navigation</a> <a href="example.com" target="_blank">somewhere</a>

Attributes

Common attributes:

  • href
  • name
  • target

Other attributes:

  • charset
  • coords
  • disabled
  • hreflang
  • media
  • methods
  • ping
  • rel
  • rev
  • shape
  • suppress
  • type
  • urn

Browser compatibility

Compatibility table legend

| Test | IE8 | IE7 | IE6 | FF3 | FF2 | Saf3 | Op9 | Chrome | |:---------|:--------|:--------|:--------|:--------|:--------|:---------|:--------|:-----------| | appears in DOM | Y | Y | Y | Y | Y | Y | Y | Y | | applies style | Y | N | N | Y | Y | N | Y | Y |

Further reading