gpt4 book ai didi

css - IFrame 在 IE 中重叠 Div(在 Chrome 中工作正常)

转载 作者:行者123 更新时间:2023-11-28 12:12:06 25 4
gpt4 key购买 nike

我写了一些代码,其中 div 应该与 IFrame 重叠。在 Chrome 中,它工作正常,而在 IE 中,IFrame 与 div 重叠。下面是代码。关于如何解决此问题以使其在 IE 和 Chrome 上都能正常工作的任何想法?

<!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>
<title>IFrame Div</title>
</head>
<body>
<div top="86px" left="5px" width="500px" height="500px" z-index="20000" style="width: 1000px;
border-color: red; height: 500px; position: absolute !important; border-color: red;
left: 5px; top: 86px; border-width: 5px; background-color: #E6E6E6; opacity: .8;">
</div>
<iframe src="http://samplepdf.com/sample.pdf" height="700px" width="600px"></iframe>
</body>
</html>

最佳答案

给出 iframe:z-index:-999;

或者您可以使用内联 CSS:<iframe src="http://samplepdf.com/sample.pdf" height="700px" width="600px" style="z-index:-999;"></iframe>

关于css - IFrame 在 IE 中重叠 Div(在 Chrome 中工作正常),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19430186/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com