固定fotter

来源:互联网 发布:淘宝店铺封面大全图片 编辑:程序博客网 时间:2024/04/29 11:12

html代码:

复制代码代码如下:

<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;} 
0 0