HTML CSS Reference/HTML Attributes Reference/shape

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

"shape" Example

    
<HTML>
<head><Title>Example For shape</Title></head>
<BODY>
<img src="yourImage.gif" alt="" width=200 height=100 usemap="#myMap">
   <map name="myMap">
      <area shape="rect" coords="0, 0, 100, 50" href=http://www.wbex.ru>
      <area shape="rect" coords="100, 0, 200, 50" href=http://www.microsoft.ru>
      <area shape="rect" coords="0, 50, 100, 100" href=http://www.msn.ru>
      <area shape="rect" coords="100, 50, 200, 100" href=http://www.yahoo.ru>
   </map>
</BODY>
</HTML>



shape is applied to

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



shape Possible Values

Possible Values

 <element                         x and y are coordinates for the circle center, and r
 shape="circle"                  represents the radius 
 coords="x, y, r">
...</element>                               
<element                         x1 and y1 represent the top-left rectangle
   shape="rectangle"             corner, and x2 and y2 represent the bottom- 
   coords="x1, y1, x2, y2">      right corner
...</element>

<element                         each x and y pair represents the coordinates 
   shape="polygon"               of a vertex in a polygon
   coords="x1, y1, x2, y2, . . . xn, yn">
...</element>
                                 The point of origin in the document is (0,0). 
                                 X increases toward the right and Y increases 
                                 toward the bottom.



"shape" Syntax and Note

Note:
    
Set the shape of an <a> or <area> element. 
This attribute must be used with the coords attribute. 
The shape attribute sets the shape of the element.
The coords attribute is used to define its size. 
Possible values of the shape attribute are 
circ, 
circle, 
rect, 
rectangle, 
poly, and 
polygon.