How to make sticky element appear behind another element?
https://jsfiddle.net/30suam6z/1/ .first { height: 100vh; background-color: red; position: relative; z-index: 2; /* Increase z-index to ensure it covers .test */ } .second { height: 100vh; background-color: yellow; position: relative; z-index: -1; } .test { width: 95%; height: 50px; background-color: green; margin: 0 auto; position: sticky; top: 70%; z-index: -1; } .third { height: 100vh; background-color:… Read More How to make sticky element appear behind another element?