[英]CSS height:auto doesn't work with my wrapper div
I was hoping someone can take a look at my site and tell me what may be going on here. 我希望有人可以看看我的网站并告诉我这里可能会发生什么。 The problem I'm having is that the #bodyWrap div is not automatically stretching to the height of one of it's children, #contentWrap.
我遇到的问题是#bodyWrap div不会自动伸展到其中一个孩子的高度#contentWrap。 #contentWrap stretches fine to fill all the content on that page, but this does not bubble up to the parent, #bodyWrap.
#contentWrap可以很好地填充该页面上的所有内容,但这不会冒泡到父对象#bodyWrap。 Thanks in advance for any insight.
提前感谢任何见解。
http://www.jacobsmits.com/placeholderRX/index.html http://www.jacobsmits.com/placeholderRX/index.html
You must add a clearer div before your closing containers: 您必须在关闭容器之前添加更清晰的div :
<div style="clear:both;"></div>
Floating items won't affect the height of the container ...coz it is floating ;). 浮动项目不会影响容器的高度 ......因为它是浮动的;)。
Working Live Example : http://jsfiddle.net/LBH5h/ 工作实例: http : //jsfiddle.net/LBH5h/
Example : 示例:
<div id="content">
<!-- floating child --> <div style="float:left;"><!-- floating child content --></div>
<div style="clear:both;"></div>
</div>
If something usually won't auto adjust the height for me then I will troubleshoot with these steps. 如果某些东西通常不会自动调整我的高度,那么我将使用这些步骤进行故障排除。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.