首页 > 开发 > CSS > 正文

纯css 实现footer 一直在页面底部,不随页面滚动

2024-07-11 08:30:37
字体:
来源:转载
供稿:网友

今天这个案例,我们希望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>

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表