Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css IFrame与IE中的Div重叠(在镀铬中工作良好)_Css_Html_Iframe - Fatal编程技术网

Css IFrame与IE中的Div重叠(在镀铬中工作良好)

Css IFrame与IE中的Div重叠(在镀铬中工作良好),css,html,iframe,Css,Html,Iframe,我已经编写了一些代码,其中div应该与IFrame重叠。在Chrome中,其工作良好,其中IE IFrame重叠部分。下面是代码。有没有办法解决这个问题,让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://w

我已经编写了一些代码,其中div应该与IFrame重叠。在Chrome中,其工作良好,其中IE IFrame重叠部分。下面是代码。有没有办法解决这个问题,让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 Div

给出iframe:
z-index:-999


或者您可以使用内联CSS:

也可以尝试向div
z-index:999添加一个正z-index看看这是否有助于解决您在哪个版本的IE中遇到的问题?它在IE 8中也不起作用。您可以尝试将上述代码保存在html文件中。您能在IE8中发布适用于您的代码吗?还有,你使用的是哪种操作系统?我使用的代码与你在问题中发布的代码完全相同。我正在使用Windows7。