A detailed introduction to the parameters of map tag and its application examples

Time:2020-11-27

Map tags must appear in pairs, i.e

<map> ….</map>

At the same time, map must be used with area.

The value of the usermap attribute in the IMG tag must be exactly the same as the ID and name values in the map tag

Area label: defines the click area of an image. Area is a single label and is not paired.

Properties:

AccessKey shortcut key

ALT picture prompt text

Coords defines the coordinates of the graph for the click area

Link address

Click on the exclusive area of the image, and when there is no such area, you need to use nohlight

Shape the shape of the clickable area

TabIndex tab key traversal

Target link target

Code example:

Copy code

The code is as follows:

<img src=”images/logo.gif” usermap=”#map”/>
<map name=”map”>
<area shape=”rect” coords=”a,b,c,d” target=”_blank” href=””/>
<! — A, B, C, D are the coordinate values of the upper left corner and the lower right corner of the rectangle respectively! >
<area shape=”circle” coords=”a,b” target=”_blank” href=”” />
<! — A and B are the coordinates of the center of the circle respectively! >
<area shape=”poly” coords=”a,b…” target=”_blank” href=”” />
<! — A and B are the coordinate values of each fixed point of the polygon respectively! >
</map>