如何将父级div置于最前面?
我的html代码如下:
我的html代码如下:
<div class="main">
<div class="parent">
<div class="child"></div>
</div>
</div>
我的css:
.main{
width : 400px;
height: 400px;
background : green;
z-index: 10;
}
.parent{
width: 100px;
height: 100px;
position: relative;
background: yellow;
z-index: 5;
}
.child{
width : 200px;
height: 200px;
background: red;
z-index : -1;
}
我的js fiddle代码: http://jsfiddle.net/gautm5154/xPvHf/
这是一个链接,指向我的js fiddle代码示例。请点击链接查看。