【发布时间】:2016-07-08 15:37:18
【问题描述】:
我有以下内容:
<div class="wrapper">
<div class="top">
</div>
<div class="left">
</div>
<div class="main">
</div>
<div class="footer">
</div>
</div>
使用以下 CSS:
.top {
position: absolute;
left: 0;
height: 80px;
width: 100%;
}
.left {
position: absolute;
left: 0; top: 80px; bottom: 100px;
width: 200px;
margin-left: 5px;
}
.main {
position: absolute;
left: 200px; top: 80px; bottom: 100px;
width: 84%;
}
.footer {
position: fixed;
bottom: 0;
left: 0;
}
我想将footer 保留在页面底部(在left 和main 之后,无论main 有多大/小),但使用position: fixed,页脚会滚动向上/向下滚动页面。我试过position: absolute 并没有将页脚一直推到底部。我已经尝试了这里找到的其他一些解决方案,但都没有奏效。如何将页脚保留在页面底部(类似于此页面底部的footer)?
提前致谢!
【问题讨论】:
-
喜欢这个jsfiddle.net/xwjhn7ej/7 ? ... 比底部窗口的视口页脚内容少 - 比容器底部的视口页脚内容多
标签: javascript jquery html css django