纯css 实现footer 一直在页面底部,不随页面滚动_ Div+Css教程-查字典教程网
纯css 实现footer 一直在页面底部,不随页面滚动
纯css 实现footer 一直在页面底部,不随页面滚动
发布时间:2016-12-27 来源:查字典编辑
摘要:今天这个案例,我们希望footer一直在页面底部,来看看解决方案吧csshtml,body,#sticker{height:100%;}bo...

今天这个案例,我们希望footer一直在页面底部,来看看解决方案吧

css

html, body, #sticker {height: 100%;}

body > #sticker {height: auto; min-height: 100%;}

#stickerCon {padding-bottom: 40px;}

#footer {margin-top:-40px; height: 40px; width: 100%; text-align: center; line-height: 40px; color: #ABA498; font-size: 12px; background: #fafafa; border-top:1px solid #E7E7E7;}

html

<div id="sticker">

<div id="stickerCon"></div>

</div>

<div id="footer">footer</div>

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新 Div+Css教程学习
    热门 Div+Css教程学习
    网页设计子分类