我有這樣的結構:使身體100%的高度
<body>
<div id="header">..</div>
<div id="content">..</div>
<div id="footer">..</div>
</body>
而這個CSS:
體{ 顏色:白色; font-family:'Play',sans-serif; max-width:2560px; margin:0 auto; min-width:960px; 身高:100%; 填充:0; }
#header {
position: relative;
overflow: hidden;
margin: 0 auto;
min-width: 960px;
height: 95px;
background-image: url("../images/header-bg.png");
}
#content {
margin: 0 auto;
position: relative;
max-width: 1600px;
height:100%;
overflow:hidden;
}
#footer {
background-color: #009EDB;
background-image: url("../images/footer-bg.png");
bottom: 0;
height: 30px;
margin: 0;
position: relative;
width: 100%;
}
但不是body
高度的瀏覽器窗口100%。我的問題是什麼?謝謝。
您是否試過添加:'html {height:100%;寬度:100%; ''? – mqchen
可能的重複[stackoverflow.com/questions/1575141/...](http://stackoverflow.com/questions/1575141/make-div-100-height-of-browser-window) – War10ck