让footer始终位于页面的最底部
2016-04-11 14:47
363 查看
<div class="container"> <div cass="header"></div> <div class="body"></div> <div class="footer"></div> </div>
第一种情况:footer随着滚动条的滚动而滚动
.container{position:relative;width:100%;min-height:100%;} .body{padding-bottom:50px;} .footer{height:50px;position:absolute;bottom:0px;left:0px;}
第二种情况:footer始终在其底部固定
.container{position:relative;width:100%;min-height:100%;} .body{padding-bottom:50px;} .footer{height:50px;position:fixed;bottom:0px;left:0px;}
注意:
1.千万不能设置.container的高度为100%,否则将无法随滚动条的滚动而滚动.
相关文章推荐
- 文章标题
- Hibernate内存溢出分析一例
- JAVA 多线程随笔 (三) 多线程用到的并发容器 (ConcurrentHashMap,CopyOnWriteArrayList, CopyOnWriteArraySet)
- 分页
- lintcode:交错正负数
- Orthographic camera-正交摄像头
- 11个人气超高的设计素材汇总网站
- pat1002
- web Android手机调试chrome://inspect/
- YTUOJ之最快合并链表(线性表)
- jstl varStatus 计数
- JAVA学习---集合系列---PriorityQueue
- 作业4:结对编程项目四则运算
- 动态规划3-------poj1050
- Jackson 高性能的JSON处理 ObjectMapper
- 数据仓库之三种事实表
- 关于deselectRowAtIndexPath
- UVA103动态规划之DAG上的最长路及其字典序
- <css 十一>relative相对定位、absolute绝对定对
- github添加远程仓库报错:fatal: remote origin already exists.