I want to make a div sticky to scrolling, but when it will always stay at the top of the footer.
I tried using position:sticky which works fine, but it doesn't work on IE11.
I also tried multiple solutions for similar issue but they always referring on how to make the footer sticky and not another <div> inside the main <div>.
This is how my code looks:
.slider {
background: #006264;
color: white;
position: sticky;
bottom: 0px;
width: 100%;
height: 60px;
}
.footer {
background: #04246A;
color: white;
font-weight: bold;
margin: 0 auto;
height: 119px;
}
<div class="main">
<div class="placeholder">This div holds place</div>
<div class="placeholder">This div holds place</div>
<div class="placeholder">This div holds place</div>
<div class="placeholder">This div holds place</div>
<div class="placeholder">This div holds place</div>
<div class="slider">
This is the footer
</div>
</div>
<div class="footer">This is the main footer</div>
Here it is on JSFiddle
How can I solve this?