I'm attempting to use sticky
positioning on one of my elements, but for some reason even if I cross the sticky threshold, my element never sticks to the page.
I've never had issues using it before until now, so I'm not entirely sure why it's not working. I've also attempted various fixes for the flexbox (like specified in other posts), and also messing around with different heights and overflow values with no change.
HTML:
<div class="navigation" id="navigation">
<div class="navigation-banner"></div>
<div class="navigation-main"></div>
</div>
CSS:
#navigation{
position: relative;
z-index: 1;
}
.navigation-banner{
color: #fff;
background: #f17e0e;
text-align: center;
font-size: 12px;
padding: 10px;
}
.navigation-main{
display: flex;
position: sticky;
position: -webkit-sticky;
top: 0px;
height: 80px;
background-color: #fff;
box-shadow: 0 7px 18px 0 rgb(0 0 0 / 4%);
box-sizing: border-box;
align-items: center;
padding: 0 30px;
}
Working JsFiddle demo for your convenience.