<!DOCTYPE html>
<html style="margin: 0">
  <body style="margin: 0">
    <div style="height: 70px; background-color: blue"></div>
    <div style="height: 2000px; transform: translateY(50px)">
        <div style="position:sticky; top: 70px; width: 100px; height: 100px; background-color: green"></div>
    </div>
</html>