HTML <a> tag


Defines an anchor. Can be used as a hyperlink to another web page, or to a different part of the same page defined by an id attribute.



Linking to an external page:

<a href="">HTML Guide</a>

Anchor point and link within the same page:

<h2 id="anchor">This is where the link will jump to</h2>

<a href="#anchor">Click here to jump to the anchor</a>

Required Attributes

  • none

Optional Attributes

  • charset - specifies the character encoding of the target page
  • coords - specifies coordinates for use in an image map. Values depend on the type of shape defined in the shape attribute: for rect, values are left, top, right, bottom. For circ, values are centerx, centery, radius. For poly, values are x1, y1, x2, y2 etc
  • href - the target of the link
  • hreflang - the language of the link target
  • name - gives the anchor a name, useful when linking to that anchor point
  • rel - specifies the relationship between the current page and the target URL
  • rev - defines the relationship between the target URL and the current page
  • shape - defines the shape used for a map. Works in combination with coords - rect, rectangle, circ, circle, poly, polygon
  • type - defines the MIME type of the target document

Core Attributes