ckground: green;
  }

  div.scroll-marker-group-after {
    overflow: auto;
    scroll-marker-group: after;
  }

  div.scroll-marker-group-after::scroll-marker-group {
    background: yellow;
  }
</style>
<div id="target1"></div>
<div id="target2"></div>
<script>
  document.documentElement.offsetTop;
  target1.className = "scroll-marker-group-before";
  target2.className = "scroll-marker-group-after";
  document.documentElement.offsetTop;
</script>