手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >纯css 实现footer 一直在页面底部,不随页面滚动
纯css 实现footer 一直在页面底部,不随页面滚动
摘要:今天这个案例,我们希望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>

【纯css 实现footer 一直在页面底部,不随页面滚动】相关文章:

用CSS实现垂直居中的3种方法

用css实现十字的布局示例代码

css3实现闪亮进度条效果

CSS挂马及相应防范方法

如何在一个页面做两种超链接的CSS样式

Div+CSS实例教程:让页脚保持在未满屏页面的底部

css实现文字的自动隐藏

纯CSS结合DIV实现的右侧底部简洁悬浮效果

用css实现文字的自动隐藏

火狐浏览器中DIV的高度不随里面的内容增高而增高

精品推荐
分类导航