<area>

Description

<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.

Example


<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><!--from w  w w . j  a v a  2  s  . co m-->
</html>

Click to view the demo

The code above generates the following result.

area




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference