我有一个包含三个嵌套分区的父分区。现在,根据我的要求,我必须添加父分区的背景图像,所有其他子分区都应该在它下面,但是父分区的背景图像显示在父分区的一半,而我想显示完整的父分区.I没有得到我所缺少的东西。
这是我的HTML..
<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。
.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
发布于 2014-08-11 21:15:47
我认为你的问题不够清楚,也没有提供小提琴,但你的意思是这样的吗?
如果是,则将此代码添加到.inner-body类中
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;https://stackoverflow.com/questions/25243627
复制相似问题