您现在的位置是:网站首页> 编程资料编程资料

纯css 实现footer 一直在页面底部,不随页面滚动前端页面弹框遮罩禁止页面滚动CSS设计之页面滚动条出现时防止页面跳动的方法使用overflow: hidden来禁用页面滚动条HTML页面滚动时部分内容位置固定不滚动的实现

2021-09-06 710人已围观

简介 CSS的简单在于它易学,CSS的困难在于寻找更好的解决方案。在CSS的世界里,似乎没有完美这种说法。所以,现在介绍的CSS绝对底部,只是目前个人见过的方案中比较完美的吧。

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


复制代码
代码如下:





相关内容

-六神源码网