首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >背景没有显示在全电视上?

背景没有显示在全电视上?
EN

Stack Overflow用户
提问于 2014-05-02 05:50:29
回答 3查看 25关注 0票数 0

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

这就是我所取得的成就:

由于某种原因,背景不会显示在整个地区。该页面在http://goo.gl/K17Fjs上直播

代码语言:javascript
复制
<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:

代码语言:javascript
复制
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}
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2014-05-02 05:52:44

overflow: hidden;添加到#overview规则中。

另外,了解http://css-tricks.com/snippets/css/clear-fix/

票数 1
EN

Stack Overflow用户

发布于 2014-05-02 07:51:00

在结束<div style="clear:both;"></div> div之前添加#overview,即在#overview-text div之后添加。

之所以出现这种情况,是因为您使用的是浮动元素&而不是清除它们。除非使用clear,否则在计算父级高度时不考虑浮动元素高度。

票数 1
EN

Stack Overflow用户

发布于 2014-05-02 05:55:47

overflow: hidden;height: auto;宽度属性添加到#概述

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23421613

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档