私は次のようなマークアップを持っている:私は赤の身長の100%を取るために黄色得ることができませんアイテムにdisplay:flex appliedが指定されていない限り、フレックスアイテムは固定位置のフレックスコンテナ内で最大高さになるのはなぜですか?
<div id="red">
<div id="yellow">
alot of text
</div>
</div>
<div id="blue">
</div>
、それが唯一の赤が溢れていても、ウィンドウの100%をとります。黄色の要素が実際にあなたの赤の要素の100%を取り、私はblock
に赤のdisplay
を設定した場合、それは動作しますが、私はフレックス必要があります...
#red {
position: fixed;
height: 100%;
overflow-y: scroll;
width: 100px;
background-color: red;
display: flex;
flex-direction: column;
align-items: stretch;
align-content: stretch;
}
#yellow {
display: flex;
flex-grow: 1;
background-color: yellow;
}
#blue {
background-color: blue;
}
どのビューポート単位については? –