我正在尝试应用粘页脚的这种方法:http://code.google.com/p/cleanstickyfooter/ http://code.google.com/p/cleanstickyfooter/
它工作得很好,但是,我有一个问题。我的特定网站的设计在页面顶部有 34 像素的边距。所以我尝试了几种实现它的方法,要么通过body {margin-top:34px}
或做container {margin-top:34px}
.
然而,在这两种情况下,粘性页脚都会变得混乱。当我尝试补偿 34px 时,它似乎从来没有成功。
有任何想法吗?
这是一个小提琴示例:http://jsfiddle.net/jrZKb/ http://jsfiddle.net/jrZKb/
使用现代简洁 CSS 粘性页脚 http://mystrd.at/modern-clean-css-sticky-footer/,它正在工作(在 FireFox 和 IE9 上):
http://jsfiddle.net/jrZKb/1/ http://jsfiddle.net/jrZKb/1/
<body>
<header> Header</header>
<article>Lorem ipsum...</article>
<footer></footer>
</body>
html {
position: relative;
min-height: 100%;
}
body {
margin: 0 0 100px; /* bottom = footer height */
}
header
{
background-color: green;
}
footer {
position: absolute;
left: 0;
bottom: 0;
height: 100px;
width: 100%;
background-color: blue;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)