【发布时间】:2015-07-14 06:42:04
【问题描述】:
我有一个多行 flexbox 布局,我想指定其中一行的高度,并让剩余的行拉伸以填充。如果我在下面设置蓝色 div 的高度,我会得到一堆空白空间。
#container {
display: flex;
flex-wrap: wrap;
height: 500px;
width: 500px;
}
#one,
#two,
#four,
#five {
flex: 1 1 49%;
}
#three {
flex: 1 1 99%;
background-color: blue;
height: 15px;
max-height: 15px;
}
#one {
background-color: green;
}
#two {
background-color: yellow;
}
#four {
background-color: orange;
}
#five {
background-color: violet;
}
<div id="container">
<div id="one"></div>
<div id="two"></div>
<div id="three"></div>
<div id="four"></div>
<div id="five"></div>
</div>
【问题讨论】: