z-index 在 Internet Explorer 中无法读取 iframe 中的 PDF
问题:
z-index 不起作用预期 iframe 在 Internet Explorer 8 中显示 PDF; iframe 出现在任何重叠元素之上。
说明:
解决方案:
要解决此问题,请插入另一个所需页面内容和 PDF iframe 之间的 iframe:
代码:
HTML:
<code class="html"><div id="outer"> <div id="inner">my text that should be on top</div> <iframe class="cover" src="about:blank"></iframe> </div> <iframe id="pdf" src="http://legallo1.free.fr/french/CV_JLG.pdf" width="200" height="200"></iframe></code>
CSS:
<code class="css">#outer { position: relative; left: 150px; top: 20px; width: 100px; z-index: 2; } #inner { background: red; } .cover { border: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index: -1; } #pdf { position: relative; z-index: 1; }</code>
此附加 iframe 充当透明覆盖层,防止 PDF iframe 与其他页面元素重叠。
支持:
此解决方案已经过测试,可在 Internet Explorer 7-9 中运行。为了与其他浏览器兼容,请考虑使用 JavaScript 添加 iframe 或将其包装在仅 IE 的条件注释中:
<code class="html"><!--[if IE]><iframe class="cover" src="about:blank"></iframe><![endif]--></code>
以上是为什么 Internet Explorer 中 Iframe 中的 PDF 的 z-index 失败?的详细内容。更多信息请关注PHP中文网其他相关文章!

Svelte Transition API提供了一种使组件输入或离开文档(包括自定义Svelte Transitions)时动画组件的方法。

前几天我只是和埃里克·迈耶(Eric Meyer)聊天,我想起了我成长时代的埃里克·迈耶(Eric Meyer)的故事。我写了一篇有关CSS特异性的博客文章,以及

文章讨论了使用CSS来获得阴影和渐变等文本效果,优化它们以进行性能并增强用户体验。它还列出了初学者的资源。(159个字符)


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

SublimeText3汉化版
中文版,非常好用

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

SublimeText3 英文版
推荐:为Win版本,支持代码提示!

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。