关于在图片上点击不同的区域进入不同页面
这几天在做一个项目的时候碰到这样的情况,比如在一个页面上有一张图片,点击不同的区域会弹出不同的页面。下面就跟大家来分享一下具体怎么实现的。
这个网页没有用a做链接,但实际上是有五个链接的.这就是usemap的用法.
什么是usemap呢?usemap是标签的一个属性,用作指明所使用的图像地图名。
area在这是区域的意思。在这个map中我们设置了5个区域。
shape是区域的形状(圆形:circle 多边形:polygon 矩形:rectangle),coords是矩形区域的左上角坐标和右下角坐标。
href是对应区域所链接的位置。
分享按钮
<img src="images/index.jpg" width="100" height="75" border="0" usemap="#Map" />
<map name="Map" id="Map">
area shape="rect" coords="483,390,928,492" href="hbds.html" />
<area shape="rect" coords="292,524,705,726" href="xinwen.html" />
<area shape="rect" coords="282,782,924,881" href="ct.html" />
<area shape="rect" coords="307,80,355,100" href="ct.html" />
<area shape="rect" coords="451,51,525,74" href="xinwen.html" />
</map>
这个网页没有用a做链接,但实际上是有五个链接的.这就是usemap的用法.
什么是usemap呢?usemap是标签的一个属性,用作指明所使用的图像地图名。
area在这是区域的意思。在这个map中我们设置了5个区域。
shape是区域的形状(圆形:circle 多边形:polygon 矩形:rectangle),coords是矩形区域的左上角坐标和右下角坐标。
href是对应区域所链接的位置。