I have a flexbox with a direct child that is declared with align-items: stretch
.
Inside this flexbox's direct child, I would like to have a div container that also uses its parent's full height (by setting height: 100%
).
However, the div container won't stretch to 100% height of its parent, unless I also set height: 100%
on the flexbox's direct child.
Is it kind of bug? Must I set the flexbox's direct child with align-items: stretch
AND height: 100%
to achieve what I want? It seem redundant to me.
Here is an example:
html,
body {
margin: 0;
height: 100%;
}
.flexbox {
display: flex;
flex-direction: row;
height: 100%;
background-color: green;
}
.flexbox-child {
// height: 100%; uncommenting this will get it to work
align-items: stretch;
background-color: blue;
}
.flexbox-grand-child {
height: 100%;
background-color: red;
}
<div class="flexbox">
<div class="flexbox-child">
<div class="flexbox-grand-child">
I want to be stretched till the bottom
</div>
</div>
</div>
http://plnkr.co/edit/FACkwsC2y65NcbOaceur?p=preview
Thanks!