<div class="main">
<div class="head"></div>
<div class="md">
<div class="content">
<div class="panel"></div>
</div>
</div>
</div>
* {
padding: 0;
margin: 0;
}
.main{
height: 100vh;
display: flex;
flex-direction: column;
}
.head{
height: 20vw;
background: grey;
flex-shrink: 0; //禁止压缩
}
.md {
display: flex;
overflow: hidden;
flex-direction: column;
}
.content{
overflow-y: auto;
}
.panel{
height: 2000px;
}
原文:https://www.cnblogs.com/clors/p/13553831.html