【发布时间】:2020-09-16 22:13:46
【问题描述】:
我正在尝试将 div #alignBottom1 和 #alignBottom2 向下对齐,但不移除父 div 左侧的浮动,也不使用绝对位置或上边距。
我该怎么办?
这是我的代码:
#TotContainer {
height: 900px;
}
#container {
max-height: 90%
}
.col-sm-6 {
width: 50%;
float: left;
height: 100%;
padding: 10px;
}
.col-sm-12 {
width: 100%;
float: left;
background: yellow;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
<div id="TotContainer">
<div id="container">
<div class="col-sm-6" style="background:blue;">XXXXXX</div>
<div class="col-sm-6" style="background:red;">
<div id="alignBottom1">Text to align at the bottom 1</div>
<div id="alignBottom2">Text to align at the bottom 2</div>
</div>
<div class="col-sm-12">footer</div>
</div>
</div>
感谢您的帮助!
【问题讨论】:
-
我不明白你想要达到什么目的。也许您可以添加所需结果的草图...?
标签: html css alignment vertical-alignment