Sticky positioning is a hybrid of relative and fixed positioning. The element is treated as relative positioned until it crosses a specified threshold, at which point it is treated as fixed positioned.
Demo
See the Pen Sticky positioning by Šime Vidas (@simevidas) on CodePen.
Read more about it – https://css-tricks.com/position-sticky-2/