<area>
defines the clickable area on a graphic or image.
The clickable area is defined using the shape and the coords attributes.
A shape can be a rectangle, square, or other geometric shape. The coords (coordinates) are used to define the size and positioning of the clickable area inside the image attributes.
This element is used in conjunction with the <map>
element,
which in turn is referenced by the usemap attribute of the <img> element.
<area> |
Yes | Yes | Yes | Yes | Yes |
HTML5 has defined new attributes, and some HTML 4.01 attributes are deprecated.
The <area> tag supports the Global Attributes in HTML.
The <area> tag supports the Event Attributes in HTML.
area { display: none; }
A demo showing how to use area tag.
<html>
<body>
<img src="http://java2s.com/style/download.png"
width="200"
height="100"
usemap="#myMap">
<map name="myMap">
<area shape="rect"
coords="0, 0, 100, 50"
href="http://www.w3c.com">
<area shape="rect"
coords="100, 0, 200, 50"
href="http://www.microsoft.com">
<area shape="rect"
coords="0, 50, 100, 100"
href="http://www.msn.com">
<area shape="rect"
coords="100, 50, 200, 100"
href="http://www.yahoo.com">
</map>
</body><!-- ww w .jav a 2 s . c om-->
</html>