Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 调整HTML地图图像的大小_Css_Html_Map_Resize Image - Fatal编程技术网

Css 调整HTML地图图像的大小

Css 调整HTML地图图像的大小,css,html,map,resize-image,Css,Html,Map,Resize Image,在一个小型网站中,页面仅由一个图像和多个链接组成,使用html地图,我想调整图像(较小的图像)的大小,但调整所有图像的大小和更改所有链接坐标是非常痛苦的 <div style="text-align:center; width:586px; margin-left:auto; margin-right:auto;"> <img id="Image-Maps_5201110040649307" src="http://site.com/ui_prototype/login.png

在一个小型网站中,页面仅由一个图像和多个链接组成,使用html地图,我想调整图像(较小的图像)的大小,但调整所有图像的大小和更改所有链接坐标是非常痛苦的

<div style="text-align:center; width:586px; margin-left:auto; margin-right:auto;">
<img id="Image-Maps_5201110040649307" src="http://site.com/ui_prototype/login.png" usemap="#Image-Maps_5201110040649307" border="0" width="586" height="1162" alt="" />
<map id="_Image-Maps_5201110040649307" name="Image-Maps_5201110040649307">
<area shape="rect" coords="59,550,297,614" href="http://site.com/ui_prototype/main_menu.html" alt="" title=""    />
</map>
</div>

解决这个问题的更好办法是什么


谢谢

您可以缩放div

示例(半码):


您可以缩放div

示例(半码):


我认为最好的解决方案是调整图像大小,然后编写一个小脚本,允许您选择一个矩形(或者简单地在图像上单击4次),提示输入和URL,然后为该矩形输出HTML。这样可以更快地生成地图


如果您看到自己在将来再次这样做,那么最好使用CSS定位的真实链接构建地图,但使用指定为相对于图像的百分比的左上角坐标。通过这种方式,你应该适应大小的变化(但不是完全改变图像)。

我认为最好的解决方案是调整图像大小,然后编写一个小脚本,允许你选择一个矩形(或只需在图像上单击4次),提示输入和URL,然后为该矩形输出HTML。这样可以更快地生成地图


如果您看到自己在将来再次这样做,那么最好使用CSS定位的真实链接构建地图,但使用指定为相对于图像的百分比的左上角坐标。通过这种方式,您应该能够适应大小的变化(但不能完全改变图像)。

这里有一个小库可以解决这个问题


这里有一个解决这个问题的小库


CSS
zoom
标签从2018年起就不推荐使用。改为使用。从2018年起,CSS
zoom
标签已被弃用。改用。
style="zoom:.5;-o-transform: scale(.5);-moz-transform: scale(.5)"