<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>demo</title>
<style>
.container{
height: 100vh;
display: flex;
flex-direction: column;
}
.top{
height: 200px;
background-color: lightblue;
}
.bottom{
flex: 1;
margin-top: 16px;
background-color: lightcoral;
}
</style>
</head>
<body>
<div class="container">
<div class="top"></div>
<div class="bottom"></div>
</div>
</body>
期望正好占一屏幕,实际是出现了滚动条,如何达到预期?
通过图片可以看到。他是包含在内的。那么你的为什么不行呢?是不是有什么其他的间距

*{padding:0;margin:0;}
尝试一下呢?