效果如图
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
margin: 0;
padding: 0;
}
body {
height: 100vh;
width: 100vw;
-webkit-touch-callout: none;
-moz-user-select: none; /*火狐*/
-webkit-user-select: none; /*webkit浏览器*/
-ms-user-select: none; /*IE10*/
user-select: none;
display: flex;
}
.reader {
position: relative;
background: bisque;
flex: 1;
display: flex;
overflow: hidden;
}
.scroll-view {
padding: 20px;
position: relative;
flex: 1;
display: flex;
background: #333333;
}
.scroll-view > div {
flex: 1;
overflow-x: hidden;
overflow-y: scroll;
}
.content {
background: bisque;
line-height: 24px;
font-size: 16px;
}
.anything {
height: 100px;
}
.anything:nth-child(2n) {
background: #0def53;
}
</style>
</head>
<body>
<div class="reader">
<div class="scroll-view">
<div>
<div class="content">
<div class="anything"></div>
<div class="anything"></div>
<div class="anything"></div>
<div class="anything"></div>
<div class="anything"></div>
<div class="anything"></div>
<div class="anything"></div>
<div class="anything"></div>
<div class="anything"></div>
<div class="anything"></div>
</div>
</div>
</div>
</div>
</body>
</html>
使用时只需要把scroll-view移动到需要自适应滚动撑满的地方就可以