我正在尝试修复页脚的错误,因为您可以看到页脚不会停留在浏览器的底部,因此它应该保持在页脚的中间位置该页面如果页面没有足够的内容,它只是遵循div其余部分的高度。网站示例:http://produccion.pugle.net/sarahbcn2/membership-cancelled/不会将页脚固定在底部
因此,我试图修复它与主div包装器上的一些CSS命令,如溢出:自动;或高度:自动;和相同的页脚命令,但没有成功。任何想法如何解决这个问题? 感谢名单
我正在尝试修复页脚的错误,因为您可以看到页脚不会停留在浏览器的底部,因此它应该保持在页脚的中间位置该页面如果页面没有足够的内容,它只是遵循div其余部分的高度。网站示例:http://produccion.pugle.net/sarahbcn2/membership-cancelled/不会将页脚固定在底部
因此,我试图修复它与主div包装器上的一些CSS命令,如溢出:自动;或高度:自动;和相同的页脚命令,但没有成功。任何想法如何解决这个问题? 感谢名单
我希望这一决定将帮助您DEMOSticky Footer
<div class="page-wrap">
<h1>Sticky Footer</h1>
<h2>with Fixed Footer Height</h2>
<button id="add">Add Content</button>
</div>
<footer class="site-footer">
I'm the Sticky Footer.
</footer>
* {
margin: 0;
}
html, body {
height: 100%;
}
.page-wrap {
min-height: 100%;
/* equal to footer height */
margin-bottom: -142px;
}
.page-wrap:after {
content: "";
display: block;
}
.site-footer, .page-wrap:after {
/* .push must be the same height as footer */
height: 142px;
}
.site-footer {
background: orange;
}
将更改应用到您的页脚(使用固定的位置):
footer {
background: none repeat scroll 0 center #fff;
bottom: 0;
display: block;
margin: 0 auto;
padding: 80px 0 0;
position: fixed;/*fixed position*/
width: 100%;
}
这解决了这个问题,thanx很多C-LINK !!!!! – bonini81 2014-09-05 14:22:43
不客气! – 2014-09-05 14:23:14
务必将您的代码在这里,而不是链接网站.. – 2014-09-05 08:29:39
Thanx的提示,下次会做! – bonini81 2014-09-05 14:19:50