HTML <area> href Attribute

Definition and Usage

href This attribute specifies the hyperlink target of the area.

If href If the attribute does not exist, the <area> tag is not a hyperlink.

Example

Use the href attribute to specify the link target for each area in the image map:

<map name="planetmap">
<area shape="rect" coords="0,0,114,576" href="sun.html" alt="Sun">
<area shape="circle" coords="190,230,5" href="mercur.html" alt="Mercury">
<area shape="circle" coords="228,230,5" href="venus.html" alt="Venus">
</map>

Try It Yourself

Syntax

<area href="URL">

Attribute Value

Value Description
URL

Specifies the hyperlink target of the specified area.

Possible values:

  • Absolute URL - Points to another website (such as href="http://www.example.com/sun.html")
  • Relative URL - Points to a file within the website (such as href="sun.html")
  • Link to an element with a specified id in the page (such as href="#top")
  • Other protocols (such as https://, ftp://, mailto:, file: etc.)
  • Scripts (such as href="javascript:alert('Hello');")

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support