我試圖讓我的頁面佔據屏幕的100%,並且頁腳需要始終位於頁面的底部。高度頁 - Div結構
當頁面調整大小時,div應該展開,並帶有正確的背景顏色。
我現在的錯誤是: - 頁腳停留在頁面底部而不是頁面。 - DIV(菜單)比格(內容)更大 - 股利不正確調整
這裏是我的代碼:
事業部stucture
<div id="container"><br />
<div id="header">CMS</div>
<div id="menu"><?php include ('includes/menu.php');?></div>
<div id="content">
<?php include $include_page?>
</div>
<div id="footer">CMS</div>
</div>
CSS
body {
height: 100%;
color: #0b0b0b;
background-color: #696060;
margin: 0px;
padding: 0px;
font-family: Tahoma, sans-serif;
font-size: 12.5px;
}
#container {
margin-left: auto;
margin-right: auto;
width: 1000px;
background-color: #f1f1f1;
border-left: 1px solid #8f8f8f;
border-right: 1px solid #8f8f8f;
height: 100%;
}
#header {
height: 100px;
width: 100%;
background-color: #a31f00;
color: #fcfcfc;
text-align: center;
}
#menu {
width: 210px;
background-color: #e0e0e0;
float: left;
padding: 10px 10px 10px 10px;
height: 100%;
}
#content {
width: 750px;
height: 100%;
float: left;
padding: 10px 10px 10px 10px;
}
#footer {
position: absolute;
bottom: 0;
width: 1000px;
height: 20px;
background-color: #a31f00;
color: #fcfcfc;
text-align: center;
font-size: 11px;
}
請格式化爲可讀格式。 – Dutchie432 2011-03-10 15:37:16
在編寫問題和答案時,StackOverflow顯示一個預覽窗格,您可以在其中查看您的文章的外觀。發佈前請確保格式正確。 – 2011-03-10 15:39:41