How to make an element sticky even if they are multiple levels deep in the DOM tree
Making an element sticky with CSS is really simple nowadays, however things can get a bit messy when we have the element deep into the DOM tree. In this tutorial I'll show you how to make sure to stick your element to the parent container even if there are multiple other elements in between. The basics In order to make a sticky element there's only two things to keep in mind: First make sure the parent element contains a scroll Make sure the children is set as sticky and the position top is the Continue reading