HTML - attributes - shape

revision:


Content

"shape" attribute : specifies the shape of an area syntax some examples


"shape" attribute : specifies the shape of an area

top

The shape attribute specifies the shape of an area and is used together with the "coords attribute" to specify the size, shape, and placement of an area.

The shape attribute can be used on the following element: <area>.


syntax

top

<area shape="value"></area >

Attribute values:

default is used to specify the entire region;
rect is used to specify the rectangular region;
circle is used to specify a circular region;
poly is used to specify the polygonal region.


some examples

top
Computer screen keyboard mouse
codes:
                    <img src="../../pics/computer-map.png" alt="Computer" usemap="#computermap">                           
                    <map name="computermap">
                    <area shape="rect" coords="253,142,16,2" alt="screen" 
                            href="javascript:alert('screen was clicked');">
                    <area shape="rect" coords="262,218,0,156" alt="keyboard" 
                            href="javascript:alert('keyboard was clicked');">
                    <area shape="circle" coords="267,234,22" alt="mouse" 
                            href="javascript:alert('mouse was clicked');">
                    </map>