HTML5,如何给图片中指定的几个地方添加链接?

如题所述

使用HTML <map>标签,给图片设置热点(指定的要添加链接的地方)
例子:
<img src="planets.jpg" border="0" usemap="#planetmap" alt="Planets" border="0" />
<map name="planetmap" id="planetmap">
<area shape="circle" coords="180,139,14" href ="venus.html" style="cursor: pointer" alt="Venus" />
<area shape="circle" coords="129,161,10" href ="mercur.html" alt="Mercury" />
<area shape="rect" coords="0,0,110,260" href ="sun.html" alt="Sun" />
</map>
关于例子的解释:
area 元素永远嵌套在 map 元素内部。area 元素可定义图像映射中的区域。
<img>中的 usemap 属性可引用 <map> 中的 id 或 name 属性(取决于浏览器),所以应同时向 <map> 添加 id 和 name 属性。

x1,y1,x2,y2
如果 shape 属性设置为 "rect",则该值规定矩形左上角和右下角的坐标。
x,y,radius
如果 shape 属性设置为 "circ",则该值规定圆心的坐标和半径。
x1,y1,x2,y2,..,xn,yn
如果 shape 属性设置为 "poly",则该值规定多边形各边的坐标。如果第一个坐标和最后一个坐标不一致,那么为了关闭多边形,浏览器必须添加最后一对坐标。
温馨提示:内容为网友见解,仅供参考
第1个回答  2015-11-02
Dreamweaver有热点工具
第2个回答  2015-03-19
热区链接,用dreamweaver就行了,不过会的话也可以自己编写代码用<map>标签本回答被网友采纳
相似回答