【问题标题】:Why does this work in firefox and chrome, but not IE8 [duplicate]为什么这在 Firefox 和 chrome 中有效,但在 IE8 中无效 [重复]
【发布时间】:2014-02-18 18:29:52
【问题描述】:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>

.box{
    display: none;
    width: 100%;
}

a:hover + .box,.box:hover{
    display: block;
    position: relative;
    z-index: 100;
}

</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<a href="Spanishwordoftheweek.pdf"><img src = "spanishwordbanner.png"  /></a><div class="box"><iframe src="Spanishwordoftheweek.pdf" width = "800" height = "1050"> <p> Your browser does not support iframe. </p></iframe></div>
</body>
</html>

这是一张在悬停时显示 pdf 的简单图片。它在 chrome 和 firefox 中完美运行,但在 IE8 中却不行。有人知道为什么吗?

谢谢

【问题讨论】:

  • 在 IE8 中什么情况下不起作用?
  • 当您将鼠标悬停在图像上时,iframe 永远不会出现。
  • 如果您打开开发者工具 (F12) 并“开始调试”,是否会出现任何 javascript 错误?
  • 没有任何javascript,上面的代码是我唯一的代码。我只是想在我的网站上实现它之前让这部分工作

标签: html css iframe


【解决方案1】:

这是 Internet Explorer 中的一个错误,其中“某些”元素不支持悬停。也许this stack overflow thread 与您的问题有关。

编辑:找到another one

【讨论】:

  • 它还说不允许我的网页运行可以访问您计算机的脚本或 ActiveX 控件。我不认为这是问题,但似乎有些人在同一件事上遇到了麻烦。
猜你喜欢
  • 2018-09-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-03-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多