Latest web development tutorials

HTML area coords attribute

Tag Reference HTML area HTML <area> tag

Examples

With clickable image map area:

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

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

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support coords attributes.


Definition and Usage

x coords attribute specifies the region and y coordinates.

coords attribute shape attribute used in conjunction to specify the size, shape and location of the region.

Tip: the upper left corner coordinates of the image is "0,0."


Differences between HTML 4.01 and HTML5

NONE.


grammar

<area coords="value">

Property Value

value description
x1, y1, x2, y2 If the shape attribute is set to "rect", then the value of the upper left corner of the rectangle specified coordinates and the lower right corner.
x, y, radius If the shape attribute is set to "circ", the predetermined value of the center coordinates and radius.
x1, y1, x2, y2,.., xn, yn If the shape attribute is set to "poly", then the value of the specified coordinates of each polygon edges. If the first and last coordinate coordinates do not match, in order to close the polygon, the browser must add the last pair of coordinates.


Tag Reference HTML area HTML <area> tag