map 的 意思是 热点图片,可以在一张图片中定义一些热点,这些热点可以实现超链接等。
在Html中,给图像使用map标签,可以给图像的某个部分建立超连接,用法如下:
<img src=img.gif usemap="MAP-Name">
<map name="MAP-Name">
<area shape="rect|circle|poly" coords="#" href="url" title="">
</map>
shape -- 定义热点形状
coords -- 定义区域点的坐标
title -- 定义鼠标放在热点区域上的提示语。
href--定义热点能够超链接的网址
注:所有的坐标都是相对于图片左上角的,是一个相对坐标。
下面是一个例子
<html>
<head>
<title>图片</title>
</head>
<body>
<img src="tupian/0.jpg" width="200" height="200" title="多么可爱"/>
<img src="tupian/2.jpg" title="多么可爱的小女孩啊." border="2" usemap="#test" width="200" height="200"/>
<map name ="test" id ="test">
<area shape="circle" coords="57,55,25" href="http://www.baidu.com" title="点击跳转到百度页面"/>
<area shape="rect" coords="100,80,150,150" href="http://hao.360.cn/?src=lm&ls=n12a73f3d90" title="点击跳转到360页面"/>
</map>
</body>
</html>