我試圖使用基於柔性框的佈局來顯示帶有粘性頁腳的頁面。這適用於所有瀏覽器中的短頁面(小於窗口高度)。然而,在Firefox中使用長頁面的方法是相同的,但IE11將容器元素剪切爲子元素的大約25%。IE11錯誤地計算父級柔性容器的高度
這裏是例如:https://codepen.io/vers/pen/rraKYP
html {
height: 100%;
}
body {
height: 100vh;
display: flex;
flex-direction: column;
}
div.container {
max-width: 600px;
background-color: #aaa;
flex-grow: 1;
display: flex;
flex-direction: column;
font-family: 'Roboto', sans-serif;
font-size: 20px;
line-height: 1.5;
}
div.content {
margin: 8px;
flex-grow: 1;
}
div.header,
div.footer {
background-color: black;
color: #fff;
}
<html>
<body>
<div class="container">
<div class="header">Header</div>
<div class="content">
<p>...</p>
<!-- 40 long paragraphs here -->
</div>
<div class="footer">Footer</div>
</div>
</body>
</html>
試過了:https://codepen.io/vers/pen/LRErLr,但不幸的是沒有改變。 –
適用於Windows 7上的IE11中的我 – blonfu
好奇,現在不起作用。但是刪除'body'中的高度 – blonfu