2

.page {
  width: 200px;
  height: 400px;
}

.outer {
  background: #f99;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.item {
  flex-grow: 1;
  border: 2px solid #099
}

.innerFlex {
  display: flex;
  flex-direction: column;
 // height: 100%;
  background: #a9a;
}
<div class="page">
  <div class="outer">
    <div class="item">
      <div class="innerFlex">
        <div class="item">A</div>
        <div class="item">B</div>
      </div>
    </div>
    <div class="item">
      sdds
    </div>
  </div>
</div>

On Firefox 63, it displays as I'd expect with .innerFlex filling 100% of it's parent element's height:

Firefox

however on Chrome 70 it does not honour the height: 100% rule as I'd expect it to:

Chrome

Why is this and how can I get round it? .item cannot have a pre-defined height as it needs to be sized according to it's flex container, which will change in my use case. Thanks!

Note: The questions this was originally marked as a duplicate for are not the same. The first didn't address flexbox, and the second didn't address the difference in behaviour between Chrome and FF.

vsync
  • 118,978
  • 58
  • 307
  • 400
BaronVonKaneHoffen
  • 1,902
  • 1
  • 21
  • 29

0 Answers0