
margin: 0
padding: 0
height:100%
}
#content {
min-height:100%
position: relative
}
#main {
padding:10px
padding-bottom: 60px
}
#footer {
position: absolute
bottom: 0
background-color: #AAA
width: 100%
}
最快的方式是将底部的设置定位,也是最常见方式。例子:
<style type="text/css">
.main{
padding-bottom: x px/*x 和底部的高度相同*/
}
.foter{
position: fixed
height: xpx/*x 是你底部的高度*/
width: 100%
left: 0px
bottom: 0px
}
</style>
<div class="header">头部</div>
<div class="main">内容</div>
<div class="footer">底部</div>
希望能给你帮助。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)