您的位置:首页 > 其它

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

2013-02-28 16:24 232 查看
<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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: