【发布时间】:2012-10-06 08:38:11
【问题描述】:
我无法让z-index 处理包含带有 IE8 的 pdf 文件的 iframe。它适用于谷歌浏览器。
示例 (JSFiddle):
HTML
<div id="div-text">
<div id="shouldBeOnTop">my text that should be on top</div>
</div>
<div id="div-frame">
<iframe src="http://legallo1.free.fr/french/CV_JLG.pdf" width="200" height="200"/>
</div>
CSS
#div-text{
position:relative;
left:210px;
top:20px
}
#shouldBeOnTop{
position:relative;
right:60px;
background-color:red;
width:100px;
z-index:2;
}
#div-frame{
position:relative;
z-index:1;
}
【问题讨论】:
-
就像stackoverflow.com/questions/12407194/…中讨论的同一问题
-
请注意,JSFiddle 示例中使用的 PDF 链接会返回一个自定义 404 错误页面,在该示例中,您不会知道它的小视口不是 PDF 文件。我不明白为什么,在玩那个例子时,当我指向我想要查看的实际生成的 PDF 文件时,我得到了不同的结果!
-
我也有同样的问题。
标签: css internet-explorer pdf iframe z-index