sticky 定位,z-index 较低就完事了。Sticky Practice - CodePen.front { width: 100%; height: 80vh; } .sticky { position: sticky; z-index: -1; top: 0; width: 100%; height: 80vh; background: orange; /* 画个 border 表现出它 sticky */ border: 32px solid #666; box-sizing: border-box; } .back { width: 100%; height: 200vh; background: #000; } <div class="front"></div> <div class="sticky"></div> <div class="back"></div>参阅:sticky - position - CSS | MDN
sticky
定位,z-index
较低就完事了。Sticky Practice - CodePen
参阅:sticky - position - CSS | MDN