HTML CSS Reference/HTML Attributes Reference/coords

Материал из Web эксперт
Перейти к: навигация, поиск

"coords" Example

<head><Title>Example For coords</Title></head>
<img src="" 
     height=100 usemap="#myMap">
     <map name="myMap">
     <area shape="rect" 
           coords="0, 0, 100, 50" 
     <area shape="rect" 
           coords="100, 0, 200, 50" 
     <area shape="rect" 
           coords="200, 0, 300, 50" 
     <area shape="rect" 
           coords="0, 50, 100, 100" 

coords is applied to

| Applied_To     |<a> (IE6 only)                  <area>                        |

"coords" Syntax and 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.