我嘗試了所有粘性頁腳CCS示例。他們都工作得很好。但是,我有一個問題。假設我有這樣的:在粘性頁腳上,如何使div邊界延伸到頁尾到頁尾?
<div id="wrap">
<div id="bodyleft">left</div>
<div id="bodyright">right</div>
<div id="footer">footer</div>
</div>
所以,如果我有height 100%
爲#bodyleft
,邊框不會擴展到視年底到頁腳。它只會涵蓋一行內容。
無論是一行還是十行,我都希望邊界延伸到頁面的末尾。
任何想法?
謝謝!
瑪麗亞
編輯:
<body>
<div id="wrap">
<div id="bodyleft">on left</div>
<div id="bodyright">
some text on right<br />
</div>
</div>
<div id="footer">footer </div>
</body>
</html>
* { margin:0px; padding:0px; }
html, body {height: 100%;}
#wrap {min-height: 100%;}
#footer {
position: fixed;
bottom: 0;
background-color: #f00;
height: 20px;
width: 100%;
margin-top:-20px; /* negative value of footer height */
}
#bodyleft{
width:222px;
float:left;
border:1px solid black;
overflow:auto;
padding-bottom:20px;
}
#bodyright{
width:777px;
float:right;
border:1px solid black;
overflow:auto;
padding-bottom:20px;
}
亞倫,謝謝你。我已經使用所有可用的變化,高度,最小高度,高度自動,高度100%..沒有任何東西可以擴展div的邊框 – MariaKeys 2010-08-19 23:23:57