需求: 两个div内容只占屏幕的一屏,不要产生纵向滚动条
<div class="topBanner"> 这个banner的高度为100px </div>
<div class="targetBox"> 这个盒子的高度跟屏幕保持一致 </div>
--css
.topBanner{
width: 100%;
height: 100px;
}
.targetBox{
width: 100%;
height: calc(100vh - 100px); // 1vh表示屏幕高度的1%
}