我完全迷失了,我读了很多东西,我仍然无法弄清楚如何在IE11中修复这个布局:(
HTML
<div class="site">
<header>
<div class="wrap">
Header
</div>
</header>
<main class="site-content">
<div class="wrap">
<aside>
<ul>
<li>Menu 1</li>
<li>Menu 2</li>
</ul>
</aside>
<article>
<h1>Hello</h1>
</article>
</div>
</main>
<footer>
<div class="wrap">Footer</div>
</footer>
</div>
CSS
body, html {
margin: 0;
}
.site {
display: flex;
min-height: 100vh;
flex-direction: column;
}
.site-content {
flex: 1;
display: flex;
}
aside {
float: left;
width: 25%;
background: #ccc;
margin-right: 5%;
}
article {
float: left;
width: 70%;
}
footer {
background: #eee;
}
header {
background: tomato;
}
.wrap {
max-width: 960px;
margin: 0 auto;
flex: 1;
display: flex;
}
DEMO:http://codepen.io/anon/pen/WoZJWj
它适用于所有浏览器,但IE11让我发疯。 提前致谢