此处用于示例的是高度的问题
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<style>
.box{
width: 100%;
height: 100px;
display: flex;
flex-direction: column;
background: gray;
}
.imu {
flex-basis: 50px;
flex-shrink: 0;
background: goldenrod;
}
.auto {
flex-grow: 1;
background: burlywood;
}
.ul {
height: 100%;
overflow-y: auto;
padding: 0;
margin: 0;
}
</style>
<body>
<div class="box">
<div class="imu"></div>
<div class="auto">
<ul class="ul">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
</ul>
</div>
</div>
</body>
</html>
之前的效果
之后的效果