1
我想将项目垂直对齐到容器底部。困难来自于.container
左移的事实,到目前为止我还没有找到解决方案。将项目对齐到容器底部
.container {
width: 40px;
height: 250px;
background: #aaa;
float: left; /* cannot be removed */
}
.item {
width: 40px;
height: 40px;
background: red;
border-radius: 50%;
}
<div class="container">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
浮动的容器不会影响我想的内部物品,我不知道你为什么强调这个部分。 – Stickers
我想是的,因为'display:table-cell'和'vertical-align:bottom'可以工作,但是只有浮动。 – julesbou