记忆碎片---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;
}
<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;
}
相关文章推荐
- 用浮动代替定位解决动态变化的div内容,一个div浮在两个div上面
- 使div浮动层显示在Select组件上面
- div背景半透明,覆盖整个可视区域的遮罩层效果(转)
- jQuery实现动态分割div—通过拖动分隔栏实现上下、左右动态改变左右、上下两个相邻div的大小
- 如何让浮动的div层显示在select组件的上面
- div背景半透明,覆盖整个可视区域的遮罩层效果
- Jquery操作div上下浮动滚动
- DIV+CSS关于浮动跑到上面的原因
- DIV在FLASH上面、FLASH透明背景
- div背景半透明,覆盖整个可视区域的遮罩层效果
- 两个常见的前端问题:如何让分页码居中显示 及 解决浮动元素覆盖的问题
- 使div浮动层显示在Select组件上面
- ie 浏览器 使 div 浮动到 3d 上面
- 弹出div浮动登陆框 背景变灰
- DIV在FLASH上面、FLASH透明背景
- 使div浮动层显示在Select组件上面
- 两个div叠加(两张图片叠加)
- div浮动到img上面
- html两个div浮动后下一个div怎么换行的问题
- (简单的弹出div 覆盖背景)改善用户体验之alert提示效果 http://www.blueidea.com/tech/web/2006/4185.asp