我使用this method在頁面的底部,讓我的頁腳正常。爲什麼我的頁腳中的CSS邊界推頁面剛剛超過100%
然而,當我添加邊框到我的頁腳,我結束了一個滾動條,而不管屏幕上的內容。我的困惑是:
我認爲邊界功能外部填充,但內部邊緣,如填充他們不會影響div外部任何佈局。
這是錯誤的嗎?
這裏是我的骨架HTML:
<body>
<div class="wrapper">
<div id="top"></div>
<div id="body">
<div id="box1"></div>
<div id="box2"></div>
</div>
<div class="push"></div>
</div>
<div class="footer"></div>
</body>
這裏是相關的CSS:
#top
{
height: 105px;
border-bottom-style: solid;
border-bottom-color: #044E97;
border-bottom-width: 7px;
}
#body
{
margin-top: 25px;
width: 100%;
background-color: white;
color: #282828;
font-size: 85%;
}
#box1
{
width: 460px;
float: left;
margin-left: 25px;
margin-right:75px;
}
#box2
{
margin-left: 25px;
margin-top: 15px;
padding-top: 0%;
padding-bottom:0%;
margin-bottom:45px;
width: 350px;
height: 320px;
float:left;
border-top-style: solid;
border-top-color: #FFFFFF;
border-top-width: 10px;
}
html
{
height: 100%;
}
body
{
min-height: 100%;
background-color: white;
margin: 0;
}
html, body
{
min-height:100%;
position:relative;
}
.wrapper
{
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -3em;
}
.footer, .push
{
height: 3em;
clear: both;
}
.footer
{
width:100%;
background-color: #0563A1;
border-top-style: solid;
border-top-color: #044E91;
border-top-width: 8px;
color: white;
font-size: 77%;
padding-top:.3em;
padding-bottom:.3em;
}
如果我改變頁腳div來沒有填充,滾動條清除。
可能重複到> https://stackoverflow.com/questions/3443606/make-footer-stick-to-bottom-of-page-correctly – vanburen