最终想达到的效果是这样,左中右div高度100%撑满全屏,然后右下一小块高度超出之后内部出现滚动条而不是浏览器的滚动条
目前是给右下一小块给定了max-height达到的效果,但是这样满足不了屏幕高度不同
请问下各位大大还有没更好的解决方案呢?
<!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>
<style>
body,
html {
margin: 0;
padding: 0;
height: 100%
}
.container {
height: 100%;
display: flex;
}
.l {
width: 300px;
background-color: chocolate;
}
.m {
flex: 1;
background-color: darkgoldenrod;
}
.r {
width: 200px;
background-color: aquamarine;
}
.search {
height: 200px;
background-color: deepskyblue;
}
.list {
overflow: auto;
max-height: 607px;
}
ul {
margin: 0;
padding: 0;
}
.item {
height: 500px;
line-height: 500px;
text-align: center;
border-bottom: 1px solid black;
list-style: none;
}
</style>
</head>
<body>
<div class="container">
<div class="l"></div>
<div class="m"></div>
<div class="r">
<div class="search">搜索</div>
<div class="list">
<ul>
<li class="item">
结果
</li>
<li class="item">
结果
</li>
</ul>
</div>
</div>
</div>
</body>
</html>
明明都用了flex...
最小改动: