You are here: Reference > HTML > attributes > shape (a, area)

shape attribute (a, area)

Browser support:
Sets the shape type of the selectable region for a hypertext or an area.
The shape and coords attributes define the position and dimensions of the area together.
JavaScript page for this attribute: shape. You can find other example(s) there.

Possible values:

String that sets the type of the shape.
One of the following values:
circ
The coordinates specified in the coords attribute define a circle.
circle
The coordinates specified in the coords attribute define a circle.
poly
The coordinates specified in the coords attribute define a polygon.
polygon
The coordinates specified in the coords attribute define a polygon.
rect
The coordinates specified in the coords attribute define a rectangle.
rectangle
The coordinates specified in the coords attribute define a rectangle.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the shape attribute:
Click on the shapes and see the location bar.<br /><br />
<img src="area.gif" width="504px" height="126px" border="0px" alt="Solar System" usemap="#SampleMap" />
<map name="SampleMap">
    <area shape="rect" coords="1,-1,83,125" alt="rectangle" href="#rect" />
    <area shape="circle" coords="234,57,30" alt="circle" href="#circle" />
    <area shape="poly" coords="363,37,380,40,399,35,420,47,426,63,423,78,430,94,409,90,395,92,379,84,371,67,370,57" alt="polygon" href="#poly" />
</map>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content