<div class="box">
<div class="el1"></div>
<div class="el2"></div>
</div>
.box {width:200px;height:500px;background:red;display:flex;flex-direction:column;}
.el1 {height:100px;background:green;}
.el2 {background:blue;flex:1}
<div class="box">
<div class="el1"></div>
<div class="el2"></div>
</div>
.box {width:200px;height:500px;background:red;display:flex;flex-direction:column;}
.el1 {height:100px;background:green;}
.el2 {background:blue;flex:1}
转载于:https://www.cnblogs.com/freespider/p/8422316.html