0
下面是簡單的HTML:爲什麼添加填充到主div而不是它的父div,換行?
<div id="wrap">
<div id="main">
</div>
</div>
<div id="footer">
</div>
這裏的CSS:
* {margin:0;padding:0;}
html, body {height: 100%;}
#wrap {min-height: 100%;}
#main {overflow:auto;
padding-bottom: 150px;}
#footer {position: relative;
margin-top: -150px;
height: 150px;
clear:both;}
我的問題是那豈不是更有意義填充底部添加到#wrap DIV,而不是它是#main div?
如果你想知道,這是關於頁腳總是在底部,並不重疊其以前的內容時調整頁面大小。
你有沒有試過你建議的方式?它可能會回答你的問題 – 2011-01-19 21:44:20