1

I'm trying to make a div fill a flex grow area on my page by using width: 100%; height: 100% to it. It works in all other browsers but Chrome. Can you see what's going wrong. Is this a bug in Chrome?

Here's the codepen

HTML:

<main>
  <h2>Heading <small>Subheading</small></h2>
  <section>
    <div id="expandMe">Content</div>
  </section>
</main>

CSS:

* {
  margin: 0; padding: 0;
}
body {
  background: black;
}
main {
  background: silver;
  display: flex;
    box-sizing: border-box;
    flex-direction: column;
    width: 90%;
    height: 100vh;
  margin: auto;
}

h2 {
  text-align: center;
  background: gray;
}

h2 > small {
  display: block;
}

main section {
  flex-grow: 1;
}

#expandMe {
  width: 100%;
  height: 100%;
  background: olive;
}
Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Leon Bacud
  • 11
  • 1

0 Answers0