使容器DIV覆盖100%的DIV高度

时间:2011-05-03 09:32:51

标签: css html height

我正在开发一个新网站并在one my pages上我无法得到我的#main div,这是我的页面内容包含DIV,可以延伸足够长的时间来覆盖内部DIV。

请检查并指出我需要修复的CSS部分。非常感谢所有人。

2 个答案:

答案 0 :(得分:2)

@bikey;恰到好处

#main {
    background: none repeat scroll 0 0 #101010;
    border-color: #333333;
    border-style: solid;
    border-width: 1px 1px 0;
    margin: 15px auto 0;
    overflow: hidden;
    padding: 20px;
    width: 920px;
}

问题在于#main divfloated元素,因此您必须先清除它。 在上面的示例中,我写了overflow:hidden&删除height:100%

答案 1 :(得分:1)

只需从height: 100%(第31行左右)的layout.css中删除#main{...} 并在<br style="clear:both;" />

之后添加<div id="content">...</div>
相关问题