这个问题涉及到一个包括flexbox在内的完全支持css3的浏览器.
我有一个装有一些物品的弹性容器.他们都是有理由的弹性开始,但我希望last,.end
项目是有理由的弹性结束.有没有一种好的方法可以在不修改HTML和不诉诸绝对定位的情况下做到这一点?
.container {
display: flex;
flex-direction: column;
outline: 1px solid green;
min-height: 400px;
width: 100px;
justify-content: flex-start;
}
p {
height: 50px;
background-color: blue;
margin: 5px;
}
<div class="container">
<p></p>
<p></p>
<p></p>
<p class="end"></p>
</div>