【发布时间】: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,上面的代码是我唯一的代码。我只是想在我的网站上实现它之前让这部分工作