I'm trying to fill the vertical space of a flex item inside a Flexbox.
And here's the JSFiddle
flex-2-child
doesn't fill the required height except in the two cases where:
flex-2
has a height of 100% (which is weird because a flex item has a 100% by default + it is buggy in Chrome)flex-2-child
has a position absolute which is also inconvenientThis doesn't work in Chrome or Firefox currently.
align-items: stretch
Similar to David Storey's answer, my workaround is:
.flex-2 {
display: flex;
align-items: stretch;
}
Alternatively to align-items
, you can use align-self
just on the .flex-2-child
item you want stretched.