CSS height:auto不能使用我的包装器div [英] CSS height:auto doesn't work with my wrapper div
问题描述
我希望有人能看看我的网站,告诉我这里可能发生什么。我遇到的问题是#bodyWrap div不会自动拉伸到它的孩子,#contentWrap的高度。 #contentWrap延伸很好以填充该网页上的所有内容,但这不会向父,#bodyWrap冒泡。感谢您提供任何洞察。
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. #contentWrap stretches fine to fill all the content on that page, but this does not bubble up to the parent, #bodyWrap. Thanks in advance for any insight.
http:// www。 jacobsmits.com/placeholderRX/index.html
推荐答案
您必须添加更清晰的div 关闭容器之前:
You must add a clearer div before your closing containers:
<div style="clear:both;"></div>
浮动项目不会影响容器的高度 ... )。
工作实例: http: //jsfiddle.net/LBH5h/
示例:
<div id="content">
<!-- floating child --> <div style="float:left;"><!-- floating child content --></div>
<div style="clear:both;"></div>
</div>
这篇关于CSS height:auto不能使用我的包装器div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!