这段代码在 Firefox、Chrome 和 Edge 中运行良好,但显然由于 flex 模型,它在 IE11 中无法正常运行。我该如何解决?
这就是它在 Firefox 中的样子
这就是它在 IE11 中的样子
body * {
box-sizing: border-box;
}
html {
height: 100%;
}
body {
min-height: 100%;
display: flex;
flex-flow: column;
margin: 0;
}
main {
flex: 1;
display: flex;
}
header,
footer {
background: #7092BF;
border: solid;
width: 100%;
}
section {
border: solid;
background: #9AD9EA;
flex: 1
}
aside {
border: solid;
width: 150px;
background: #3E48CC
}
<header>
<p>header
</header>
<main>
<aside>
<p>aside
<p>aside
</aside>
<section>
<p>content
<p>content
<p>content
<p>content
</section>
</main>
<footer>
<p>footer
<p>footer
</footer>
原文由 user6420862 发布,翻译遵循 CC BY-SA 4.0 许可协议
根据 Flexbugs :
以下是一些解决方法:
1. 始终填充视口 + 可滚动
<aside>
和<section>
:2. 初始填充视口 + 正常页面滚动,添加更多内容: