这就是我的HTML/CSS 目前的样子:

这是我想要的样子:

如何修改下面的HTML/CSS,以便显示我想要的内容?
HTML:
<div id="panel">
<div id="bottom">
<div class="update"></div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.update {
width: 100%;
background-color: #006699;
text-align: center;
height: 56px;
color: white;
}
#bottom {
position: absolute;
bottom: 20px;
width: 100%;
left: 0;
}
#panel {
width: 21.25%;
height: 100%;
background-color: #0794ea;
float: left;
padding: 0 1.5%;
-moz-box-sizing: border-box;
box-sizing: border-box;
position: relative;
}
Run Code Online (Sandbox Code Playgroud)
谢谢
Dan*_*erd 10
您可以使用包装器解决问题
您的HTML将看起来像这样:
<div id="panel">
<div class="wrapper">
<div id="bottom">
<div class="update">
a
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
而你的CSS:
#panel {
width: 21.25%;
height: 100%;
background-color: #0794ea;
float: left;
padding: 0 1.5%;
box-sizing: border-box;
}
.update {
width: 100%;
background-color: #006699;
text-align: center;
height: 56px;
color: white;
}
.wrapper {
position: relative;
height: 100%;
}
#bottom {
position: absolute;
bottom: 20px;
left: 0;
width: 100%;
background: yellow;
}
Run Code Online (Sandbox Code Playgroud)
这是最终结果的笔:http://codepen.io/DanielVoogsgerd/pen/Lezjy
| 归档时间: |
|
| 查看次数: |
7062 次 |
| 最近记录: |