HTML shape Attribute

HTML shape Attribute: This attribute defines the shape of an area. This attribute is used together with the coords attribute to specify the size, shape, and placement of an area.

HTML shape Attribute

This attribute can be applied to <area> element.

Syntax: <area shape=”default|rect|circle|poly”>



Browser Support

This attribute is supported by the following browsers:

  • Chrome
  • Internet Explorer
  • Safari
  • Opera
  • Firefox

Example: for <area> element

<!DOCTYPE html>
<html>
<body>
<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">
<map name="planetmap">
  <area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
  <area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
  <area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>
</body>
</html>

Output:

HTML shape attribute