繁体   English   中英

图片地图可在Internet Explorer中使用,但不能在Chrome中使用

[英]Image Map works in Internet Explorer, but not Chrome

我使用以下代码设置了一个带有图像映射的页面。 该映射可在Internet Explorer 10、11,Edge和FireFox中使用,但不能在Chrome中使用。 知道我缺少什么吗?

<center><img src="Live View.png" width="1024" height="768" border="0" 
usemap="#map" /></center>
<map id="Map" name="Map">
<area shape="rect" coords="530,50,650,100" href="live view.html" target="_self" />
<area shape="rect" coords="662,58,821,118" href="Setup.html" target="_self" />
<area shape="rect" coords="315,550,370,520" href="1x1.html" target="_self" />
<area shape="rect" coords="390,550,445,520" href="2x2.html" target="_self" />
<area shape="rect" coords="455,550,505,520" href="3x3.html" target="_self" />
<area shape="rect" coords="525,550,650,520" href="fullscreen.html" target="_self" />    
</map>

您的ID不匹配。 您在image元素中引用了#map ,但是地图的ID为Map 标识符区分大小写。

修复ID后,Chrome可以正常运行:

 <center><img src="http://via.placeholder.com/1024x768" usemap="#map"></center> <map id="map" name="map"> <area shape="rect" coords="530,50,650,100" href="live view.html" target="_self" /> <area shape="rect" coords="662,58,821,118" href="Setup.html" target="_self" /> <area shape="rect" coords="315,550,370,520" href="1x1.html" target="_self" /> <area shape="rect" coords="390,550,445,520" href="2x2.html" target="_self" /> <area shape="rect" coords="455,550,505,520" href="3x3.html" target="_self" /> <area shape="rect" coords="525,550,650,520" href="fullscreen.html" target="_self" /> </map> 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM