I was trying to learn the sticky position property in CSS. But I am to able to understand why the sticky property is not working. What am I doing wrong?
Here is the snippet that I am trying.
.container {
display: flex;
}
.box {
height: 200px;
width: 200px;
background: lightblue;
}
.boxA {
position: sticky;
position: -webkit-sticky;
top: 0px;
/* required */
height: 900px;
overflow-y: auto;
}
<div class="container">
<div class="box boxA">A should stick</div>
<div class="box">B should scroll</div>
</div>
Any pointers are appreciated !!