【发布时间】:2015-05-05 11:31:06
【问题描述】:
我需要像页眉内容和页脚这样的布局。
我的要求是……
页脚Div的默认位置在底部,即使内容Div中没有内容。
当内容Div的内容展开时,整个正文(包括页眉、页脚)需要在内容Div的基础上展开
我不需要位置:固定为页脚Div....
我已经在我的项目中尝试了一些代码......
CSS:
body
{
height:100%;
margin-left: 0;
margin-top: 0;
padding:0;
width:100%;
position: relative;
display:block;
}
.container
{
display:table;
width:100%;
height:100%;
}
.header
{
top:0px;
height:75px;
width:100%;
}
.content
{
width:100%;
height:auto;
position: relative;
}
.footer
{
top:5px;
bottom:0px;
height:45px;
overflow:hidden;
width:100%;
}
代码:
<div>
<div class="header">
Header Div
</div>
<div class="content">
Content Div
</div>
<div class="footer">
Footer Div(Need it,default at bottom position)
</div>
</div>
有什么想法吗?
注意:我也需要在IE中运行这段代码......
【问题讨论】:
-
在 google 或这里搜索
sticky footer有很多解决方案