HTML <area> href-eigenschap

Definitie en gebruik

href Bepaalt de eigenschap het hyperlinkdoel van het gebied.

Als href Bestaat de eigenschap niet, dan is de <area>-tag geen hyperlink.

Voorbeeld

Gebruik de href-eigenschap om voor elke regio in de afbeeldingskaart een linkdoel te specificeren:

<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

Specify the hyperlink target of the 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