這是目前我的網站: HTML5/CSS頁腳問題,用100%的高含量
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
</head>
<body>
<section id="wrapper">
<header>
</header>
<main>
<section class="content">
Test
</section>
</main>
<footer>
</footer>
</section>
</body>
</html>
CSS
html, body {
margin: 0;
padding: 0;
height: 100%;
background: #e4e4e4 !important;
font-family: Helvetica, Arial, "Lucida Grande", sans-serif !important;
font-weight: 300;
color: #fff !important;
}
#wrapper {
min-height:100%;
position:relative;
}
header {
height: 193px;
line-height: 193px;
background: #bc0000;
}
main {
padding-bottom:137px;
}
.content {
width: 60%;
margin-left: auto;
margin-right: auto;
background: #000;
}
footer {
width:100%;
height:137px;
position:absolute;
bottom:0;
left:0;
background: #bc0000;
}
我想黑內容框爲100 %高度。
我已將此添加CSS
#wrapper, main, .content {
height: 100%;
}
與本站看起來是這樣的: 我怎樣才能讓黑色區域是從僅有頭到頁腳不破壞現場?
感謝
background:#e4e4e4!important; < - 在這種情況下,您應該永遠不需要使用!重要的 –
稍後我將使用引導程序,然後使用它。 – plexcell