Why do I need to define a height for position sticky?
<div class="content">
<div class="contentGrid"> {# css grid element #}
{# other stuff #}
<div class="sideBar"> {# some stuff inside sidebar #} </div>
</div>
</div>
Does not work:
.sideBar {
position: sticky;
top: 0;
}
Does work:
.sideBar {
position: sticky;
top: 0;
height: 100px; // why tho?
}
Why is there a height needed? How can I make this relative to the content? An absolute px height will inevitabely to lead problems down the road.