HTML <area> hrefAttribute

HTML area 标签参考手册HTML <area> Tag

Examples

Image map with clickable areas:

<img src="planets.gif.html" width="145" height="126" alt="Planets"
usemap="#planetmap">

<map name="planetmap">
<area shape="rect" coords="0,0,82,126" href="sun.htm.html" alt="Sun">
<area shape="circle" coords="90,58,3" href="mercur.htm.html" alt="Mercury">
<area shape="circle" coords="124,58,8" href="venus.htm.html" alt="Venus">
</map>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the href attribute.


Definition and Usage

The href attribute specifies the target of the link in the area.

If the href attribute is not used, the <area> tag is not a link.


Differences Between HTML 4.01 and HTML5

In HTML5, the <area> tag no longer uses the href attribute; it uses placeholder to specify the link.


Syntax

<area href="URL.html">

Attribute Values

Value Description
URL

The URL of the link. Possible values:

  • Absolute URL - points to another site (e.g. href="http://www.example.com/sun.htm")
  • Relative URL - points to a file within the site (href="sun.htm")
  • Anchor URL - points to an anchor in the page (href="#sun")


HTML area 标签参考手册HTML <area> Tag

Other Extensions