Skip to content

Pure CSS overlay scrolling

using only css and html, is it possible to scroll away the inner div (overlay red div) completely before scrolling down the rest of the page? Essentially, wondering if overlay scrolling while freezing the behind div is possible in only css? Then once the red div is gone, unfreeze the background scrolling and continue on. Similar to this site here: . Or would some sort of JavaScript need to be used?

.headervideo{background-color:blue; width:100%; height:900px;}
.headerbreak{width:100%; height:300px;}
.headervideo #inner-box {
  background-color: red;
  height: 90%;
  width: 100%;
<div class="headervideo">
  <div id="inner-box"></div>
<div class="headerbreak">


position:sticky can approximate this:

.headervideo {
  background: url( center/cover;
  height: 100vh;
  position: relative;
  z-index: 2;
.nextsection {
  background: url( center/cover;
  height: 100vh;
  margin-top: -100vh;
  position: sticky;
  top: 0;
.container {
body {
  margin: 0;
<div class="container">
  <div class="headervideo"></div>
  <div class="nextsection"></div>
<div style="height:150vh"> more content later </div>