HTML 怎么在HTML中将中国的各个省拼成一个完整的中国地图 然后点击每个省就会跳转新的页面怎么弄啊
3条回答 默认 最新
- 0x0007 2023-05-30 15:07关注
Demo :
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>中国地图</title> <style> #map { position: relative; display: inline-block; background-image: url('china-map.png'); /* 地图图片 */ background-size: cover; width: 800px; height: 600px; } .area { position: absolute; cursor: pointer; background-color: rgba(0,0,0,0); } /* 省份热区的坐标及大小 */ #area-beijing { left: 300px; top: 120px; width: 40px; height: 40px; } #area-shanghai { left: 420px; top: 290px; width: 40px; height: 40px; } /* 更多省份热区... */ </style> </head> <body> <div id="map"> <a href="beijing.html"><div id="area-beijing" class="area"></div></a> <a href="shanghai.html"><div id="area-shanghai" class="area"></div></a> <!-- 更多省份热区... --> </div> </body> </html>
解决 1无用