Html 添加高度后文本溢出容器:自动添加到容器
我有一个网页,其中文本溢出一个容器div,即使在应用Html 添加高度后文本溢出容器:自动添加到容器,html,css,Html,Css,我有一个网页,其中文本溢出一个容器div,即使在应用height:auto之后到包含的div。页面的组成如下所示: <html> <head> <body> <div id="wrapper"> <div id="inner_wrapper"> <div id="content_left"> <div class="main_content_text">
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>
我正在应用它的页面位于此处添加以下规则
#内部包装器:{content:”;显示:块;溢出:隐藏;清除:两者;高度:0;}
它将清除浮动,无需添加额外的
元素为所需的div设置溢出:自动
#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;
}