I know a solution is set the parent element to relative, and the child the to absolute. Can anyone use a more flex way? (Do not use absolute)
Please do not mark the question easily as duplicate with Make flexbox children 100% height of their parent
Because i have tried the flex way mentioned by @David Storey in that thread, it seems i can only make it work in the flex-direction: row layout, and it cannot work in my fiddle (flex-direction: column) layout.
HTML:
<div class="d-flex flex-column h-100">
<div class="p-2 d1">Flex item 1</div>
<div class="p-2 d6 flex-grow-1 d-flex position-relative">
<div class="inner h-100 flex-grow-1">
background-color: green;
</div>
</div>
</div>
CSS:
html,body{
height: 100%;
}
.d1 {
background-color: yellow;
}
.d6 {
background-color: green;
}
.inner {
background-color: red;
}