为什么在IE8中,父元素子元素后面流动的pesudo元素的背景颜色?文本在前面流动,但背景颜色没有。 Z指数似乎没有任何帮助。隐藏在IE8上的子图像后面的父元素上的伪元素
我一直无法确定这是否是IE8中的错误。这似乎是一个非常常见的用例,但我找不到许多博客文章或SO相关的问题。
<div id="parent">
<img src="http://placehold.it/200x200">
</div>
#parent{ padding: 20px; }
#parent:before{
content: 'Behind the image';
position: absolute;
top: 0;
left: 0;
width: 100px;
height: 100px;
background-color: red;
}
编辑:A related Stack Overflow Question about Stacking Order
罗伯特嗨,你有没有找到一个变通这个问题? –
我真的不记得 - 但我不认为我做了 – Robert