【发布时间】:2012-12-10 07:49:21
【问题描述】:
我有一个包含两个子弹性项目的弹性框标题。这些弹性项目又拥有自己的孩子。
有没有办法覆盖弹性项目的垂直对齐方式,使其子项在底部对齐?
div.flexbox {
display: flex;
align-items: stretch; /* cross axis */
justify-content: space-between; /* main axis */
flex-flow: row wrap;
border-bottom: 1px solid #ddd;
min-height: 100px;
}
.item-1, .item-2 {
padding: 10px;
}
.item-1 {
width: 30%;
position: relative;
}
.item-2 {
width: 60%;
}
<div class="flexbox">
<div class="item-1">
<span>I want to be aligned at the bottom of item-1</span>
</div>
<div class="item-2">
<span>I want to be aligned at the bottom of item-2</span>
</div>
</div>
【问题讨论】: