HTML area coords Attribute
HTML <area> tag
Definition and Usage
The coords attribute specifies placement of an area in a specified object or
image.
Used together with the map element and shape attribute.
Syntax
<area coords="coordinates" />
|
Syntax Example
<area coords ="0,0,82,126" />
|
Attribute Values
Value |
Description |
left,top,right,bottom |
If shape attribute is "rect" (rectangle). Specifies the
coordinates of the four corners of the rectangle. |
centerx,centery,radius |
If shape attribute is "circ" (circle). Specifies the
coordinates of the circle center and the radius. |
x1,y1,x2,y2,..,xn,yn |
If shape attribute is "poly" (polygon). Specifies the
coordinates of each of the edges of the polygon. |
Browser Support
The attribute is supported in all major browsers.
Example
Source |
Output |
<p>Click on one of the planets:</p>
<img src ="planets.gif" width="145" height="126" alt="Planets" usemap ="#planetmap"
/>
<map id ="planetmap"
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>
|
Click on one of the planets:
|
Try-It-Yourself Demos
area coords
attribute example
Specify the location of the area in the image map.
HTML <area> tag
|
|
|