If you're wondering how to tackle this issue, my suggestion would be to set the sidebar position as fixed. This way, it will remain in place even when you scroll through the rest of the page.
For an updated version, check out this fiddle: https://jsfiddle.net/odukje08/3/
Best of luck!
Update: I also included some flex properties for the sidebar to improve responsiveness and ensure it maintains the correct height.
.container {
display: flex;
height: 2000px;
overflow-y: hidden;
}
.left {
background-color: red;
width: 20%;
position: fixed;
left: 0;
top: 0;
height: 100vh;
display: flex;
flex-direction: column;
}
.left-bottom {
background-color: green;
height: 100%;
overflow-y: auto;
}
.right {
flex-grow: 1;
padding-left: 20%;
}
<div class="container">
<div class="left">
<div class="left-top">
<p>
This is the top
</p>
</div>
<div class="left-bottom">
<p>
stuff
</p>
// more content
</div>
</div>
<div class="right">
<h1>
hello
</h1>
<p>
this is the right side. You can scroll me too!
</p>
</div>
</div>