我在这里阅读了很多关于这个问题的其他帖子,但没有任何效果。我希望背景图片延伸到整个页面的长度,但它只向下延伸了 2/3。
html, body { height: 100%; }
div#body-wrapper {
height:100%;
position:relative;
}
nav#side-navigation {
height:100%;
width:185px;
background-color:#C2F4C2;
float:left;
}
div#content-wrap {
width:775px;
height:100%;
float:right;
position:relative;
background:transparent url(../images/global/column_corner.gif) no-repeat top left;
}
如果我将 overflow:hidden 添加到 #body-wrapper,它会切断网站底部的一部分。
最后,这是有效的源代码:http://freshbaby.com/v20/about_us/index.cfm
最佳答案
您可以在 float 元素之后添加一个元素来“清除” float 。
<div style="clear:both"></div>
关于css - 子 float Div 脱离父 Div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9844982/