0

I'm trying to achieve the following scrolling behavior in my project: Initial State

I want div2 to scroll beneath div1 and div1 to stay on the top, now that is doable by setting div1's position as sticky, but the trick is that I want div3 to stay exactly under div1, and div4 to scroll beneath div3, and for div5 to stay exactly under div4 upon scrolling, to end with the following state:

Final state

Is there a way to do this other than setting div3 and div5 positions to sticky? Since I don't want to set top:x because x varies.

  • This might help- https://stackoverflow.com/questions/54689034/pure-css-multiple-stacked-position-sticky – Neha Soni Dec 08 '22 at 12:30

0 Answers0