div自动撑满剩余高度
<div class="main"> <div class="top"></div> <div class="bottom"></div> </div>
.main { width: 100%; height: 100%; } .top { height: 100px; background: pink; } .bottom { position: absolute; width: 100%; top: 100px; left: 0; bottom: 0; background: yellowgreen; }
转自:https://www.cnblogs.com/chxl800/p/13408755.html