1

我有一个网页,整个页面都有一个大容器。在里面<div>我有<div>另一个float:left。然后,浮动到那个孩子的右边,<div>我有第二个容器,它将包含其他<div>s。辅助容器正在折叠。我已经搜索并尝试了其他解决方案,但他们没有解决任何问题。顺便说一句,这是一个 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>
4

2 回答 2

2

嗨,现在给bodyhtml height 100%

像这样

body, html{
height:100%;
}

演示

于 2012-08-30T04:41:36.583 回答
0

能解决问题吗?

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

于 2012-08-30T04:43:36.567 回答