<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>滚动吸顶效果</title>
<style>
.top {width:100%; height:160px; background:#b7eb87;}
.make {width:100%; height:100px; position:sticky; top:0px; background:#f100bd;z-index: 100;}
.content {width:100%; background:#ffbc00; height:1000px;}
</style>
</head>
<body>
<div class="top"></div>
<div class="make">滚动到顶部吸顶位置</div>
<div class="content"></div>
</body>
</html>
css实现滚动吸顶效果
于 2020-09-23 15:09:39 首次发布