Firefox、Chrome 等浏览器中的图像映射支持
Chrome 和 Firefox 是否支持图像映射? w3schools 似乎表明他们是。
鉴于此,为什么以下 HTML 会失败? (图像已显示,但链接不起作用 - 它在 IE 中可以正常工作)
<img src="Images/backgroundFinal.png" usemap="#mainImageMap" alt="MainBackground" style="border: none;" />
<map id="mainImageMap">
<area shape="rect" alt="Home Page" title="Home Page" coords="309,198,413,223" href="Default.aspx" target="" />
<area shape="rect" alt="About me" title="About me" coords="245,334,319,353" href="About.aspx" target="" />
<area shape="rect" alt="Gallery" title="Gallery" coords="437,271,497,300" href="Gallery.aspx" target="" />
<area shape="rect" alt="Tattoo" title="Tattoo" coords="249,478,307,503" href="Tattoo.aspx" target="" />
<area shape="rect" alt="Contacts" title="Contacts" coords="395,521,464,544" href="Contact.aspx" target="" />
</map>
Are image maps supported in chrome and firefox? w3schools seems to suggest they are.
Given this, why would the following HTML fail? (Image is displayed but no links work - It does work correctly in IE)
<img src="Images/backgroundFinal.png" usemap="#mainImageMap" alt="MainBackground" style="border: none;" />
<map id="mainImageMap">
<area shape="rect" alt="Home Page" title="Home Page" coords="309,198,413,223" href="Default.aspx" target="" />
<area shape="rect" alt="About me" title="About me" coords="245,334,319,353" href="About.aspx" target="" />
<area shape="rect" alt="Gallery" title="Gallery" coords="437,271,497,300" href="Gallery.aspx" target="" />
<area shape="rect" alt="Tattoo" title="Tattoo" coords="249,478,307,503" href="Tattoo.aspx" target="" />
<area shape="rect" alt="Contacts" title="Contacts" coords="395,521,464,544" href="Contact.aspx" target="" />
</map>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将
更改为
。如果需要,您可以保留
id
,但只需确保存在name
属性即可。Try changing
<map id="mainImageMap">
to<map name="mainImageMap">
. You can keep theid
if required but just make sure aname
attribute` is there.