http://fengshen-xia.javaeye.com/blog/295948
Div即父容器不根据内容自动调节高度,我们看下面的代码:
- < div id = "main" >
- < div id = "content" > </ div >
- </ div >
<div id="main">
<div id="content"></div>
</div>
- < a name = "entrymore" > < div id = "main" >
- < div id = "content" > </ div >
- < div style = "font: 0px/0px sans-serif;clear: both;display: block" > </ div >
- </ div > </ a >
<div id="main">
<div id="content"></div>
<div style="font: 0px/0px sans-serif;clear: both;display: block"> </div>
</div>
- < a name = "entrymore" > < div id = "main" >
- < div id = "content" > </ div >
- < div style = "height:1px; margin-top:-1px;clear: both;overflow:hidden;" > </ div >
- </ div > </ a >
<div id="main">
<div id="content"></div>
<div style="height:1px; margin-top:-1px;clear: both;overflow:hidden;"></div>
</div>
- < a name = "entrymore" > < div id = "main" >
- < div id = "content" > </ div >
- < br style = "clear:both;" />
- </ div > </ a >
<div id="main">
<div id="content"></div>
<br style="clear:both;" />
</div>