通过html<map>标签给图片加链接

前面我们有谈到了通过图片定位给一张图片添加多个链接,现在用另外一种方法来实现,用html<map>标签给图片加链接

<img src="/images/hlj.jpg" border="0" usemap="#Map" alt="">
<map name="Map" id="Map"><area shape="rect" coords="798,298,956,340" href="/dot.html" />
</map>

shape 属性为 "rect",表示方形,该值规定矩形左上角坐标(798,298)和右下角的坐标(956,340)。

参考资料:

<area> 标签

http://www.w3school.com.cn/tags/tag_area.asp

http://www.w3school.com.cn/tags/att_area_coords.asp

方形和圆形案例http://www.w3school.com.cn/tiy/t.asp?f=html_areamap

原文地址:https://www.cnblogs.com/ytkah/p/5237260.html