我有以下的div制作DIV适合剩余高度
<div class="top">
<div class="inner1"></div>
<div class="inner2"></div>
<div class="inner3"></div>
</div>
这里的CSS:
.top {
height: 100vh;
}
.div1 {
min-height: 215px;
box-sizing: border-box;
height: 30vh;
}
.div2 {
box-sizing: border-box;
min-height: calc(100vh - 30vh - 265px);
padding-top: 2.5em;
margin-top: 0;
display: table;
}
.div3 {
min-height: 265px;
box-sizing: border-box;
background: white;
display: table;
width: 100%;
font-weight: 700;
padding-bottom: 42px;
}
我不想使用钙(100vh - 30vh - 265px)设置分 - div的高度2.如何获得剩余高度(意思是div2 height = 100vh - div1 height - div2 height。
我猜Flex可能在这里很有用,但我不是相当确定如何使用它。任何帮助都是g非常感谢。
谢谢?
在将此标记为重复项之前,请注意:我尝试使用flex,但在IE11中效果不佳。
应该在IE11正常工作。你能举一个例子吗?唯一的问题将是IE10,你将不得不使用-ms-前缀。 –
看起来像http://stackoverflow.com/questions/25098042/fill-remaining-vertical-space-with-css-using-displayflex/25098486的副本如果您愿意使用flex –
Flexbox在IE11中正常工作.. .. –