startbootstrap-sb-admin-2
startbootstrap-sb-admin-2 copied to clipboard
CSS code to fixed navbar and sidebar
i just wanna share my css code that fixed the sidebar and navbar. hope you add it to your main css file.
this is the code:
#wrapper {
position: fixed;
overflow: hidden;
top: 0; right: 0; bottom: 0; left: 0;
}
nav.navbar {
position: sticky;
position: -webkit-sticky;
top: 0px;
}
Thank For Code. You Saved My Lots of time.
Add a z-index in the nav.navbar to see if it is displayed forward in the case of scroll.
nav.navbar {
position: sticky;
position: -webkit-sticky;
top: 0px;
z-index: 999;
}
Thank For Code.
This code works. But I just noticed that it affects the display of the Modal and the Scroll To Top button...
For those who have problem with modal - solution: https://stackoverflow.com/questions/32459337/how-to-remove-bootstrap-modal-overlay It's the .modal-backdrop which is broken through the commands.
After fixing elements, the line position is not saved after page refresh