Page 81 - HTML5
P. 81
Chapter 19: Image Maps
Syntax
• <img usemap="#[map-name]">
• <map name="[map-name]"></map>
• <area>
Parameters
Tag/Attribute Value
Below are the image map-specific attributes to use with <img>. Regular <img>
<img>
attributes apply.
The name of the map with a hash symbol prepended to it. For example, for a
usemap
map with name="map", the image should have usemap="#map".
<map>
The name of the map to identify it. To be used with the image's usemap
name
attribute.
Below are <area>-specific attributes. When href is specified, making the
<area> <area> a link, <area> also supports all of the attributes of the anchor tag (<a>)
except ping. See them at the MDN docs.
The alternate text to display if images are not supported. This is only
alt
necessary if href is also set on the <area>.
The coordinates outlining the selectable area. When shape="polygon", this
should be set to a list of "x, y" pairs separated by commas (i.e.,
coords shape="polygon" coords="x1, y1, x2, y2, x3, y3, ..."). When
shape="rectangle", this should be set to left, top, right, bottom. When
shape="circle", this should be set to centerX, centerY, radius.
The URL of the hyperlink, if specified. If it is omitted, then the <area> will not
href
represent a hyperlink.
The shape of the <area>. Can be set to default to select the entire image (no
shape coords attribute necessary), circle or circ for a circle, rectangle or rect for a
rectangle, and polygon or poly for a polygonal area specified by corner points.
https://riptutorial.com/ 65

