Easy Tutorial
❮ Tag Comment Att Label Form ❯

HTML <a> coords Attribute

HTML <a> Tag

Example

The following example uses the shape and coords attributes in the <a> element to create an image map:


Browser Support

Currently, only Firefox and Opera browsers support the coords attribute.


Definition and Usage

The coords attribute is typically used together with the shape attribute to specify the dimensions, shape, and position of the link in an <object> or <img> element.

The coordinates of the top-left corner are 0,0.

Tip: To create an image map that works in all browsers, use the <area> element.


Syntax

Attribute Values

Value Description
x1,y1,x2,y2 If the shape attribute 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 attribute 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 attribute is set to "poly", this value specifies the coordinates of the sides of the polygon. If the first and last coordinates are not the same, the browser must add the last pair of coordinates to close the polygon.

HTML <a> Tag

❮ Tag Comment Att Label Form ❯