创建图像映射

来源:互联网 发布:js获取数据第几个元素 编辑:程序博客网 时间:2024/05/22 08:20

本例显示如何创建带有可供点击区域的图像地图。其中的每个区域都是一个超级链接。

代码:

<html>
<body>


<p>请点击图像上的星球,把它们放大。</p>


<img
src="/i/eg_planets.jpg"
border="0" usemap="#planetmap"
alt="Planets" />


<map name="planetmap" id="planetmap">


<area
shape="circle"
coords="180,139,14"
href ="/example/html/venus.html"
target ="_blank"
alt="Venus" />


<area
shape="circle"
coords="129,161,10"
href ="/example/html/mercur.html"
target ="_blank"
alt="Mercury" />


<area
shape="Rect"
coords="0,0,110,260"
href ="/example/html/sun.html"
target ="_blank"
alt="Sun" />


</map>


<p><b>注释:</b>img 元素中的 "usemap" 属性引用 map 元素中的 "id" 或 "name" 属性(根据浏览器),所以我们同时向 map 元素添加了 "id" 和 "name" 属性。</p>


</body>
</html>

显示效果:


0 0
原创粉丝点击