1

这是简单的html:

<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不是更有意义吗?

如果您想知道,这与页脚始终位于底部并且在调整页面大小时不与之前的内容重叠有关。

4

1 回答 1

0

我猜你可能会在使用盒子模型时遇到麻烦,因为填充会增加#wrap- 你试过了吗?

于 2011-01-19T21:44:59.580 回答