Chrome不会将弹性增长容器填充到100%

时间:2018-02-21 18:18:23

标签: css css3 flexbox flex-grow

我正在尝试使用width:100%在我的页面上填充flex增长区域;身高:100%。它适用于所有其他浏览器,但Chrome。你能看出出了什么问题。这是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;
}

0 个答案:

没有答案