如何在2021年8月13日使用HTML5实现图片的局部热点区域跳转?
最编程
2024-02-12 21:55:24
...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<!-- 让页面显示一张图片,引用myMap划分多个热区 -->
<img src='./img/universe.jfif' usemap="#myMap" height="500">
<map name='myMap'>
<!-- 热区为圆型,圆心位置-190*150,半径139;该热区跳转至www.baidu.com;在新标签打开链接 -->
<area shape="circle" coords="190,150,130" href="http://www.baidu.com" target="_blank">
<!-- 热区为矩形,左上坐标-600*400,右下角坐标-700*500;该热区跳转至www.weibo.com;在新标签打开链接 -->
<area shape="rect" coords="500,350,600,450" href="http://www.weibo.com" target="_blank">
</map>
</body>
</html>
下一篇: 让图片热点更聪明:自适应热区与边框设定