如果图像不在顶部,则usemap无法正常工作

时间:2012-03-11 18:08:05

标签: html

如果图像不在顶部,则

usemap无效。 有没有解决方法? 请帮忙。感谢。

<div id="wrapper" style="position:relative; width:1000px; height:900px;">
    <div style="width:100%; height:100%; position:absolute; top:10px; left:10px; z-index:10">
        <iframe width="680" height="580" src="http://www.google.com.my"></iframe>
    </div>
    <div style="width:100%; height:100%; position:absolute; top:10px; left:0px;">
        <img src="images/fun run 2012/background.jpg" usemap="#funrun2012" alt="Fun Run 2012" />
        <map id="funrun2012" name="funrun2012">
            <area shape="rect" coords="945,230,770,270" href="EventDetails.aspx" alt="Event Details" />
            <area shape="rect" coords="945,290,770,330" href="Routes.aspx" alt="Routes" />
            <area shape="rect" coords="945,350,770,390" href="Prizes.aspx" alt="Prizes" />
            <area shape="rect" coords="945,410,770,450" href="FAQ.aspx" alt="FAQ" />
            <area shape="rect" coords="945,470,770,510" href="Map.aspx" alt="Map" />
        </map>
    </div>
</div>

1 个答案:

答案 0 :(得分:0)

您的问题不在于图片,而在于iframe的div大小。

这样可行:

<div style="width:700px; height:600px; position:absolute; top:10px; left:10px; z-index:10">
    <iframe width="680" height="580" src="http://www.google.com.my"></iframe>
</div>