即使在滚动时,如何在浏览器屏幕的底部设置div逗留?使用CSS或jQuery的粘滞页脚
-1
A
回答
3
使用position: fixed
财产的附加到该div
的CSS。
#footer {
position:fixed;
bottom:0;
}
6
假设你有以下的div
<div class="footer">This is at the bottom</div>
你可以把它贴在视口的底部与下面的CSS
.footer {
position: fixed;
bottom: 0;
}
滚动时,会呆在那里连。
1
有这个CSS一试:
* {
margin: 0;
}
html, body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -142px; /* the bottom margin is the negative value of the footer's height */
}
.footer, .push {
height: 142px; /* .push must be the same height as .footer */
}
0
0
有一个在
http://www.lwis.net/journal/2008/02/08/pure-css-sticky-footer/
演示页面优良的页脚教程在这里:
http://www.lwis.net/profile/CSS/sticky-footer.html
的基本前提是,主体页面被拉伸到100%的页面。最小的高度也是100%。
然后页脚给出以下规则:
#footer {
clear: both;
position: relative;
z-index: 10;
height: 3em;
margin-top: -3em;
}
我得到的答案从this
相关问题
- 1. 粘滞页脚CSS
- 2. Css粘滞页脚 - 响应
- 3. CSS粘滞页脚失败
- 4. CSS粘滞页脚问题
- 5. 实现CSS - 粘滞页脚
- 6. CSS粘滞页脚问题
- 7. jquery粘滞页脚问题
- 8. HTML/CSS - 粘滞页脚问题
- 9. CSS粘滞页脚 - 保证金
- 10. 用ASP.NET粘滞页脚
- 11. 粘滞页脚的问题
- 12. 使用jQuery只使用粘滞页脚(sub-footer和主页脚底部)
- 13. 手机粘滞页脚
- 14. 粘滞页脚在底部
- 15. IE8粘滞页脚问题
- 16. 粘滞页脚和动画
- 17. 粘滞页脚和IE
- 18. 粘滞页脚不工作
- 19. 粘滞页脚,或者说:内容不会延伸到页脚
- 20. 固定顶部导航+使用jquery粘滞页脚
- 21. CSS - 粘页脚
- 22. 使用JQuery粘滞元素
- 23. CSS粘滞页脚内容时不占用
- 24. MobileAngularUI内部的粘滞页脚部分
- 25. WordPress的粘滞页脚二十二
- 26. 使用CSS的粘滞div位置
- 27. 粘性CSS页脚
- 28. jQuery粘页脚
- 29. CSS jquery滚动粘滞菜单
- 30. CSS - 粘滞页脚+补充工具栏问题
http://www.google.com/search?q=sticky+footer+using+css –
@Pranav我看到你的谷歌搜索,并提出你一个网站搜索:http://stackoverflow.com/search?q=sticky+footer+css 759个问题。愚蠢的愚蠢。 –
[CSS,粘性页脚]的可能重复(http://stackoverflow.com/questions/10465250/css-sticky-footer),[粘性页脚CSS](http://stackoverflow.com/questions/5822825/sticky- footer-css)以及与这些问题相关的数十个问题。 –