html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
</title>
<meta charset="UTF-8" />
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="format-detection" content="telephone=no" />
</head>
<style>
.box{
width: 100%;
height: 100%;
top: 0;
left: 0;
position: fixed;
overflow-y: scroll;
/* scroll-snap-type: y mandatory; */
scroll-snap-type: y proximity;
}
.item{
position: relative;
min-height: 100vh;
scroll-snap-align: start;
scroll-snap-stop: always;
}
</style>
<body>
<div class="box">
<div class="item" style="background-color: black;"></div>
<div class="item" style="background-color: #e0e0e0;height: 150vh;"><p style="position: absolute;top: 0;">头部文字</p><p style="position: absolute;bottom: 0;">底部文字</p></div>
<div class="item" style="background-color: #999999;height: 120vh;"></div>
</div>
</body>
</html>
