Hello,
I’m trying to make a simple div to be sticky at the top of my page whenever a user scrolls down. The div is initially below the header and it’s supposed to stick at the top when the user scrolls.
Stick
Simple div.
#sticky-div {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 1000;
padding: 10px;
text-align: center;
}
CSS related to the div.
I’ve already set the Header not to be sticky. But something is preventing my div to stick anyway.
Appreciate any help ![]()