你如何使图像在图像的不同区域在 HTML 中可点击并导致不同的 URL ......例如我有一个图像或“按钮”,如果你愿意那是 1 个图像但我想要它实际上是 2 个链接...按钮的一侧是“注册”,而另一侧是“试用”
最佳答案
使用 HTML 图像映射:http://www.javascriptkit.com/howto/imagemap.shtml
例子:
<img src="button.gif" usemap="#yourmap" border="0">
<map name="yourmap">
<area shape="rect" coords="0,0,50,50" href="http://www.yoursite.com/link1.html">
<area shape="rect" coords="50, 0, 100, 100" href="http://www.yoursite.com/link2.html">
</map>
关于html - 1 图片 2 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4305109/