Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.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
Html 在IE中未单击横幅图像上的链接_Html_Css_Internet Explorer - Fatal编程技术网

Html 在IE中未单击横幅图像上的链接

Html 在IE中未单击横幅图像上的链接,html,css,internet-explorer,Html,Css,Internet Explorer,我在我的网站上有一个宣传横幅 HTML结构是这样的 <a href="#"><img src="#" usemap="abc"></img></a><map name="abc"><area ...></map> 当我在Chrome、FireFox、Opera或任何其他浏览器(IE除外)中单击横幅时,它工作正常 但是当我在IE中尝试同样的东西时,它不是点击。悬停时,它会显示相应的URL,但该URL不可单击。

我在我的网站上有一个宣传横幅

HTML结构是这样的

<a href="#"><img src="#" usemap="abc"></img></a><map name="abc"><area ...></map>

当我在Chrome、FireFox、Opera或任何其他浏览器(IE除外)中单击横幅时,它工作正常

但是当我在IE中尝试同样的东西时,它不是点击。悬停时,它会显示相应的URL,但该URL不可单击。
您可以通过在横幅上单击鼠标右键或单击URL一次,然后按enter键来访问URL


如果有人知道什么,请让我知道。

这在任何浏览器中都会非常有效:

<div id="promotion_banner"> 
<a href="2.html"> <img src="r.jpg" alt="ABC" usemap="#hide_promo" onclick="location.href='2.html'" style="cursor: hand;"/> </a> 
<map name="hide_promo"> 
    <area shape="rect" coords="20,235,42,260" id="hide_promotion" alt="text" /> 
</map> 
</div>
使其可点击

请注意
:我故意在两个地方给出了URL:

 (1)<a href="2.html"> 
 (2)"location.href='2.html'"
(1)
(2) “location.href='2.html'”
因为第二个
onclick=“location.href='2.html'
是受支持的,并且只有在IE中才能正常工作


对于除IE
以外的所有浏览器(chrome、safari、firefox、opera),您不需要关闭img标签。划掉我之前的评论。没有区域和地图,这行得通吗?你也在W3学校尝试过吗?在您的浏览器中是否可以这样做?将整个代码粘贴到此处并屏蔽url@btevfik我试过很多东西。我关闭了图像标签,也没有关闭它们,但它仍然不工作。我尝试了与w3schools相同的方法,文本即将出现,但无法点击。欢迎@Prateek,如果有用,请向上投票并接受答案:)谢谢!欢迎@Prateek,如果我的答案有用,请投票并接受答案:)谢谢!!!:)
 onclick="location.href='2.html'"
 (1)<a href="2.html"> 
 (2)"location.href='2.html'"