儿童集装箱倒塌

时间:2012-08-30 04:38:08

标签: css html

我有一个网页,整个页面都有一个大容器。在<div>内,我有另一个<div> float:left。然后,浮动到该子<div>的右侧,我有第二个容器,其中包含其他<div>个。辅助容器正在折叠。我搜索并尝试了其他解决方案,但他们没有解决任何问题。顺便说一句,这是一个html5页<!DOCTYPE html>。有任何想法吗? CSS:

body {
    border: 0px;
    padding: 0px;
    margin: 0px;
    background: white;
    overflow: hidden;
    height: 100%;
    font-family: Hanuman;
}
#container {
    margin: 0 auto;
    background: red;
    height: 100%;
    width: 100%;
    overflow: hidden;
}
#bibletree {
    padding: 0;
    margin: 0;
    height: 100%;
    width: 15%;
    float: left;
    background: blue;
    overflow: auto;
    white-space:nowrap;
}
#container2 {
    margin: 0 auto;
    height: 100%;
    width: 85%;
    background: gray;
    float: right;
    overflow: auto;
}

HTML:

<div id="container">
     <div id="bibletree">
          stuff here
     </div>
     <div id="container2">
          there will be two other divs here as well. This one is collapsing.
     </div> 
</div>

2 个答案:

答案 0 :(得分:2)

您好现在请bodyhtml height 100%

就像这样

body, html{
height:100%;
}

Demo

答案 1 :(得分:0)

This会解决问题吗?

(将overflow:hidden添加到#container2的规则?)