1 What is image mapping
The so-called image mapping refers to the definition of a number of areas in a map, each region specifies a different hyperlink, when you click a different area can jump to the corresponding target page.
2 Creating an image map
2.1 Defining a map area
Define a map area use the map marker to add a map area between <MAP> and </MAP>. Add a map region using the area marker. The marker has three basic properties:
href identifies the URL of the destination
Shape describes the shapes of the mapped area. Value but:
Rect rectangle
Circle Circle
Poly Polygon
The default entire image area Coords is used to identify the boundaries of the mapped area.
2.2 Referencing a mapped region
Once the map region is marked, you can refer to the corresponding mapping information by using the UserMap property in the IMG tag.
A complete image mapping syntax is as follows:
<map name= "mymap" >
<area href=url1 shape=rect coords= "X1,y1,x2,y2" >
<area href=url2 shape=circle coords= "X,y,r" >
<area href=url3 shape=poly coords= "x1,y1,x2,y2,..., Xn,yn" >
</map>
usemap=#mymap>//Note that there is a # number in front of the name.
Note:The value of the name attribute in the map marker must be the same as the value of the Usemap property in the IMG tag, except that the value of the Usemap property is preceded by a #.
HTML syntax-using image mapping