11

Flexbox column container inside another flex container doesn't get 100% height in Chrome, but in Firefox and Edge all ok.

Codepen example

.container {
  display: flex;
  flex-direction: column;

  height: 100%;
  width: 100%;

  .inside-container {
    display: flex;
    flex-direction: column;

    height: 100%;

  }
}
Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
fotonmoton
  • 565
  • 1
  • 7
  • 17

1 Answers1

22

You're missing a height: 100% on a parent element: <header>

Once you add that in, the layout works in Chrome, as well.

header {
   min-height: 100%;
   width: 100%;
   height: 100%; /* NEW */
}

Revised Codepen

When using percentage heights, Chrome requires that each parent element have a defined height. More details here:

When using percentage heights in flexbox, there are rendering differences among the major browsers. More details here:

Community
  • 1
  • 1
Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701