在Firefox,Chrome和其他浏览器支持图像映射 [英] Image map support in firefox, chrome and other browsers

查看:137
本文介绍了在Firefox,Chrome和其他浏览器支持图像映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Chrome和Firefox中支持图像映射吗? w3schools似乎暗示他们是



鉴于此,为什么下面的HTML会失败? (图片显示,但没有链接工作 - 它在IE中正常工作)

 < img src =图片/ backgroundFinal。 pngusemap =#mainImageMapalt =MainBackgroundstyle =border:none; /> 
< map id =mainImageMap>
< area shape =rectalt =Home Pagetitle =Home Pagecoords =309,198,413,223href =Default.aspxtarget =/>
< area shape =rectalt =关于我title =关于我coords =245,334,319,353href =About.aspxtarget =/>
< area shape =rectalt =Gallerytitle =Gallerycoords =437,271,497,300href =Gallery.aspxtarget =/>
< area shape =rectalt =Tattootitle =Tattoocoords =249,478,307,503href =Tattoo.aspxtarget =/>
< area shape =rectalt =Contactstitle =Contactscoords =395,521,464,544href =Contact.aspxtarget =/>
< / map>


解决方案

尝试更改<地图id =mainImageMap> < map name =mainImageMap> 。你可以保留 id (如果需要的话),但是确保 name 属性存在。


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>

解决方案

Try changing <map id="mainImageMap"> to <map name="mainImageMap">. You can keep the id if required but just make sure a nameattribute` is there.

这篇关于在Firefox,Chrome和其他浏览器支持图像映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆