记忆碎片---div叠加覆盖,上下两个div做背景,上面浮动div框

<div style="z-index:0; height:100%;">
<div class="t_half"></div>
<div class="b_half"></div>
</div>
<div class="loginbox"></div>

之前两个背景div不显示是因为height没有继承100%。。层层嵌套,好像是body 和form都没有设height。

css:


.t_half
{
width:100%;
height:65%;
background-color:#65a60a;
border-bottom:1px solid #568a0d;
position:relative;
z-index:2;
}
.b_half
{
width:100%;
height:35%;
background-color:#7fbe27;
border-top:1px solid #9ae235;
position:relative;
z-index:1;
}

.loginbox

{

height:450px;
width:100%;
margin: 10px auto auto auto;
position:absolute;
z-index:99;
top: 80px;
left: 0px;
}

posted @ 2013-02-28 16:24  过期臭豆腐  阅读(597)  评论(0)    收藏  举报