0

我有一个网页,其中文本溢出容器 div,即使在应用height:auto;到包含 div 之后也是如此。页面的组成如下所示:

<html>
<head>
<body>
<div id="wrapper"> 

    <div id="inner_wrapper">

        <div id="content_left">
                <div class="main_content_text">
                      Overflowing text
                </div><!--end of main_content_text-->
        </div><!--end of content_left-->

        <div id="content_right">
        </div><!--end of content_right-->

    </div><!--end of inner_wrapper-->
 </div><!--end of wrapper-->
 </body>
 </html>

我使用的 CSS 如下所示:

#inner_wrapper{
width: 100%;
background-color: white;
min-height: 900px;
height: auto;
margin: 0px auto;
  }

#content_left{
padding: 10px;
margin: 10px 10px 30px 20px;
width: 57%;
min-height: 300px;
float: left;
 }

.main_content_text{
width: 625px;
height: auto;
font-weight: normal;
font-family: 'Source Sans Pro','Ubuntu Light','Ubuntu Condensed',Ubuntu,Tahoma,Arial,sans-serif;
font-size: 15px;
line-height: 20px;
margin-top: 30px;
padding-bottom: 10px;
}

我正在应用它的页面在这里网站

4

2 回答 2

0

设置overflow:auto你需要的 div !

于 2013-02-21T10:39:15.793 回答
0

添加以下规则

#inner_wrapper:after { 内容: " "; 显示:块;溢出:隐藏;明确:两者;高度:0;}

它将清除浮动,无需添加其他<div class="clear">元素

于 2013-02-20T23:51:03.140 回答