Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML area coords property

HTML coords property

HTML area Tag Reference HTML tag

Example

An image map with clickable areas:

<

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 the coords property.


Definition and Usage

The coords property specifies the x and y coordinates of the area.

The coords property is used together with the shape property to specify the size, shape, and position of the area.

Tip: The coordinates of the top-left corner of the image are "0,0".


Differences between HTML 4.01 and HTML5

NONE.


Syntax

Attribute values

Value Description
x1,y1,x2,y2 If the shape property is set to "rect", this value specifies the coordinates of the top-left and bottom-right corners of the rectangle.
x,y,radius If the shape property is set to "circ", this value specifies the coordinates of the center and the radius of the circle.
x1,y1,x2,y2,..,xn,yn If the shape property is set to "poly", this value specifies the coordinates of each vertex of the polygon. If the first and last coordinates do not match, the browser must add the last pair of coordinates to close the polygon.

HTML area Tag Reference HTML tag