藍色箱子應該是100%的高度。它適用於爲div.a
設置像素高度,但不幸的是,這不適用於真實世界的情況。高度:100%不能在柔性箱內工作flex-grow
這或許說明了一切: http://codepen.io/anon/pen/jrVEpB
.a{
background-color:red;
display:flex;
}
.b1{
flex-grow:0;
background-color:green;
}
.b2{
flex-grow:1;
background-color:yellow;
height:100%;
}
.c{
height:100%;
background-color:blue;
}
<div class="a">
<div class="b1">
<p>hurr durr</p>
<p>hurr durr</p>
<p>hurr durr</p>
<p>hurr durr</p>
<p>hurr durr</p>
<p>hurr durr</p>
</div>
<div class="b2">
<div class="c">
miksi et ole full height saatana
</div>
</div>
</div>
c上的高度:100%,它需要父母的高度。但沒有高度或100%的父母的高度是不是整個屏幕.. – MrBuggy
刪除'高度:100%'在'.b2' – blonfu