'coords' Syntax and Note : coords « HTML Attributes Reference « HTML CSS Reference






'coords' Syntax and Note

Note:
    
This attribute sets the coordinates of an <a> or <area> element. 
It is used in conjunction with the shape attribute. 
The shape attribute determines the shape of the object.
The coords attribute determines the size of the shape.

Syntax for a circle shape, 
<element shape="circ" coords="x, y, r"> . . . </element>
x and y are coordinates for the center
r represents the radius:

Syntax for a rectangle shape
<element shape="rect" coords="x1, y1, x2, y2"> . . . </element>
x1 and y1 are the top-left corner coordinates
x2 and y2 represent the bottom-right corner coordinates:


Syntax for a polygon shape
<element shape="poly" coords="x1, y1, x2, y2, . . . xn, yn"> . . . </element>
Each x and y pair represents the coordinates of a vertex in the polygon.

The origin for each coordinate is the upper-left corner. 
The x coordinate increases toward the right.
y coordinate increases toward the bottom.
    
Syntax:


      
      








Related examples in the same category

1.'coords' Example
2.coords is applied to