Im有一些問題讓粘滯腳註在我的網站上工作。如果內容小於窗口,頁腳應該停留在窗口的底部,死區應該填滿div。我認爲CSS Sticky Footer這樣做,但我不能讓「推動div」工作推動內容一路下降。正如你所看到的,我的代碼不僅僅是body-wrapper-footer。CSS Sticky Footer實現問題
<body>
<div id="banner-bg">
<div id="wrapper">
<div id="header-bg">
<!-- header stuff -->
</div> <!-- end header-bg -->
<div id="content-bg">
<div id="content">
<!-- content stuff -->
</div> <!-- end content -->
</div> <!-- end content-bg -->
</div> <!-- end wrapper -->
</div> <!-- end banner-bg -->
</body>
body {
color: #00FFFF;
background-image: url("Images/img.gif");
font-size: 1em;
font-weight: normal;
font-family: verdana;
text-align: center;
padding: 0;
margin: 0;
}
#banner-bg {
width: 100%;
height: 9em;
background-image: url("Images/img2.gif"); background-repeat: repeat-x;
position: absolute; top: 0;
}
#wrapper {
width: 84em;
margin-left: auto;
margin-right: auto;
}
#header-bg {
height: 16em;
background-image: url("Images/header/header-bg.png");
}
#content-bg {
background-image: url("Images/img3.png"); background-repeat: repeat-y;
}
#content {
margin-right: 2em;
margin-left: 2em;
}
我對CSS Sticky Footer-code應該放在哪裏感到困惑。
編輯,繼承人我得到了什麼,我想做什麼: alt text http://bayimg.com/image/gacniaacf.jpg
CSS Sticky Footer在FF3或IE8中都不適用於我。也許這是問題的一部分。 – Eric 2009-07-11 10:56:39
我已經更新了我的答案,以包含佈局的實際代碼示例。在IE8和FF2中爲我工作得很好。5 – ChssPly76 2009-07-12 04:48:57