我需要將橙色按鈕對齊在藍色的底部。 用我目前的flex代碼,我無法得到想要的結果。任何想法如何解決它?由於如何在另一個使用柔性盒的底部對齊div?
.content {
width: 350px;
height: 150px;
background-color: yellow;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.row1 {
background-color: red;
}
.row2 {
background-color: blue;
height: 100px
}
.icon {
width: 50px;
height: 50px;
background-color: orange;
align-items: center;
justify-content: center;
}
<div class="content">
<div class="row1">
</div>
<div class="row2">
<div class="icon">
</div>
</div>
</div>
。圖標不能使用任何flex屬性,因爲它的父級沒有flex屬性 – monkeyinsight