I'm working on creating a simple admin panel and have set up a sidebar layout. My goal is to keep the sidebar fixed so that it doesn't scroll when I scroll down the page. Initially, it looks like this:
https://i.sstatic.net/dcFX3.png
However, as I scroll down the page, the sidebar also scrolls down, which is not what I want. This is how it appears after scrolling:
https://i.sstatic.net/oMcUo.png
I want to maintain the appearance from the first picture even when the page is scrolled. The initial sidebar code snippet is as follows:
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar" style="max-height:100%">
Edit: I attempted
.navbar-nav { position: fixed; left: 0; top: 0; bottom: 0, width: 150px; }
with the following result:
https://i.sstatic.net/R61bo.png