首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >背景图像未在全分幅中显示

背景图像未在全分幅中显示
EN

Stack Overflow用户
提问于 2014-08-11 20:45:14
回答 1查看 54关注 0票数 0

我有一个包含三个嵌套分区的父分区。现在,根据我的要求,我必须添加父分区的背景图像,所有其他子分区都应该在它下面,但是父分区的背景图像显示在父分区的一半,而我想显示完整的父分区.I没有得到我所缺少的东西。

这是我的HTML..

代码语言:javascript
复制
<div id="innerbody" class="inner-body">

 //First Div      

<div id="tele" style="margin-left:auto; margin-right:auto; width:1080px; height:325px;">
<div id="telec" style="position:inherit; float:left; width:180px; height:325px;">
<p style="padding-top:20px;">
<br /><br /><br /><br /><br />
 Telecommunication</p>
</div>
<div id="teledesc" style="position:inherit; width:870px; margin-top:20px; height:325px; float:left;">
</div>
</div>
</div>

  //Second and Third Div like this

</div>

这是我的css。

代码语言:javascript
复制
 .inner-body
{
margin-left:auto; 
margin-right:auto; 
width:100%; 
height:1350px; 
margin-top:-20px; 
font-size:18px; 
color: #6c3f00; 
background: url('../img/new_images/innerbody_bg.jpg') center center no-repeat;
background-size: 100%;
}

请帮帮我..Thanks

EN

回答 1

Stack Overflow用户

发布于 2014-08-11 21:15:47

我认为你的问题不够清楚,也没有提供小提琴,但你的意思是这样的吗?

如果是,则将此代码添加到.inner-body类中

代码语言:javascript
复制
display: table;
width: 100%;
background: url('../img/new_images/innerbody_bg.jpg') no-repeat center center fixed; 
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25243627

复制
相关文章

相似问题

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