0
我讀過一個非常類似的帖子,並嘗試了所有的解決方案,並沒有喜悅。這是我的。我有全寬(100%)頁眉和頁腳空間以及較小寬度的容器的網站。我使用了Ryan Fait粘性頁腳,但容器(帶有白色背景)沒有伸展到頁腳,除非我只是放入一堆換行符,這會破壞粘性頁腳的目的。使用粘腳,不能得到主要內容的背景,以延伸到頁腳
樣式:
html, body {
height: 100%;}
body {
margin:0;
padding:0;
}
html {
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -30px;}
.container {
width:1050px;
margin: 0 auto 0 auto;
min-height: 100%;
height: auto !important;
height: 100%;
padding:0 25px 0 25px;
background-color:#FFF;
}
.footer, .push {
height: 30px;}
.footer {
background-color:#000;
width:100%;
height: 30px;}
和HTML:
<div class="wrapper">
<div class="container">
/* content */
</div>
<!--end container-->
<div class="push"></div>
</div>
<!--end wrapper-->
<div class="footer">
/* footer */
</div>
<!--end footer-->