CSS实现footer一直在页面底部
2016-10-11 17:29
507 查看
CSS实现footer一直在页面底部,如果文档不够一页,这footer在底部,否则,footer跟随在文档底部
效果图如下:HTML代码如下:
<div class="wrapper"> <div class="header"> <h4>Header</h4> </div> <div class="container"> <h4>Container</h4> <p>container</p> <p>container</p> <p>container</p> <p>container</p> <p>container</p> <p>container</p> <p>container</p> <p>container</p> <p>container</p> <p>Last Container</p> </div> <div class="footer"> <h4>Footer</h4> </div> </div>
CSS代码如下:
* { margin: 0; padding: 0; } html, body { height: 100%; } .wrapper { min-height: 100%; position: relative; } .header { height: 50px; background: #999; } .container { padding-bottom: 100px; } .footer { background: #999; position: absolute; bottom: 0; width: 100%; height: 100px; }
相关文章推荐
- 纯css 实现footer 一直在页面底部,不随页面滚动
- div footer标签css实现位于页面底部固定
- 【Web Trick 4】CSS 实现footer固定页面底部
- css实现让页面的footer始终位于底部
- footer适应在窗口或者页面底部的css实现方法
- 利用CSS使footer固定在页面底部
- 将footer固定在页面底部的实现方法
- 实现底部footer在内容较少时固定在页面底部
- 利用CSS使footer固定在页面底部的实例代码
- footer固定在网页底部且居中,超过一屏自动撑开(最简单的CSS实现)
- 当页面内容不够的时候,怎么让footer一直底部显示?
- 利用CSS使footer固定在页面底部
- Footer固定在页面底部(CSS)
- Css Sticky Footer将页脚固定在页面底部
- 页面前台-用DIV+CSS让footer始终在底部
- 纯css实现固定在页面底部的div层
- 让footer固定在页面(视口)底部(CSS-Sticky-Footer)
- css让footer始终位于页面的最底部
- css让footer永远保持在页面底部
- css实现footer底部自粘