这就是我想要达到的目标:

这就是我所取得的成就:

由于某种原因,背景不会显示在整个地区。该页面在http://goo.gl/K17Fjs上直播
<div id="overview">
<img src="images/home-layout_17.png" alt="">
<div id="overview-text">
<h1>Overview</h1>
<p>Salem Al Hajri is a Company, registered under Qatar law, providing services in building construction, maintenance and manpower supply.</p><p>The main business of the company is to provide well trained, experienced, dedicated and hard working workers to the client. We will mobilize the construction workforce you need, for long or short-term projects, anywhere in the Qatar. Our team of construction professionals offers a single-source solution for all of your construction-related needs whether its restoration, site preparation, a new facility or facility renovation, we have the experience and personnel to provide the highest quality... Read More.</p>
</div>
</div>我的CSS:
h1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 28px;
font-weight: normal;
color: #53504a;
}
#overview {
background-color: #f6f6f6;
border: 1px solid #dbdada;
border-radius: 10px;
margin-top: 21px;
padding: 12px;
}
#overview img { float: left;}
#overview-text { float: left; width: 650px; padding-left: 12px}发布于 2014-05-02 05:52:44
将overflow: hidden;添加到#overview规则中。
另外,了解http://css-tricks.com/snippets/css/clear-fix/。
发布于 2014-05-02 07:51:00
在结束<div style="clear:both;"></div> div之前添加#overview,即在#overview-text div之后添加。
之所以出现这种情况,是因为您使用的是浮动元素&而不是清除它们。除非使用clear,否则在计算父级高度时不考虑浮动元素高度。
发布于 2014-05-02 05:55:47
将overflow: hidden;、height: auto;和宽度属性添加到#概述中
https://stackoverflow.com/questions/23421613
复制相似问题