Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.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
Html 位置绝对z指数叠加不';我不在IE8工作_Html_Css_Internet Explorer 8 - Fatal编程技术网

Html 位置绝对z指数叠加不';我不在IE8工作

Html 位置绝对z指数叠加不';我不在IE8工作,html,css,internet-explorer-8,Html,Css,Internet Explorer 8,我有一个div,它绝对位于另一个div之上,以提供某种覆盖: <div id="main_container"> <div id="overlay"></div> <p>This is a product title</p> <img src="http://cdn-images.farfetch.com/10/63/37/08/10633708_3137969_400.jpg"></img&g

我有一个div,它绝对位于另一个div之上,以提供某种覆盖:

<div id="main_container">
    <div id="overlay"></div>
    <p>This is a product title</p>
    <img src="http://cdn-images.farfetch.com/10/63/37/08/10633708_3137969_400.jpg"></img>
</div>
问题是这在IE8中不起作用

我的问题是,在IE8中有没有可能有一个绝对定位的覆盖层,具有更高的z指数


谢谢

另外,您不能在ie8中使用rgba颜色,这就是为什么不显示您的背景。查看此链接以获得支持:@Paulie_D我已经阅读了该技巧,但从我的理解来看,z-index不只是适用于绝对元素吗?我只有一个绝对元素,那就是overlay@BillK是的,我知道背景不会出现,但我同意。我只需要显示覆盖,这样用户就不能直接点击下面的元素了。
rgba()。您必须使用半透明PNG(例如Fireworks FTW)或
#RRGGBB+不透明度
。z索引部件工作得非常好,请参见(在原件上测试IE8@W7)
#main_container {
    float: left;
    position: relative;
}

#overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.61);
    z-index: 9;
    cursor: pointer;
 }