Start Bootstrap SB Admin侧边导航栏无法滚动问题解决方法
Hey folks! I recently ran into the exact issue where the sidebar navigation in the SB Admin template wouldn’t scroll when there were too many menu items. I fixed it by adding this custom CSS snippet to my stylesheet—worked like a charm for me, though there might be more optimized solutions out there. Sharing it just in case it helps you too:
.navbar-sidenav { overflow-y: auto !important; -ms-overflow-style: none !important; } .navbar-sidenav::-webkit-scrollbar { width: 0px !important; display: none !important; }
Here’s a quick run-through of what each part does:
overflow-y: auto !importantturns on vertical scrolling only when the sidebar content exceeds its height-ms-overflow-style: none !importanthides the default scrollbar in IE and Edge- The
::-webkit-scrollbarrule removes the scrollbar in Chrome, Safari, and other WebKit-based browsers for a cleaner visual
Feel free to adjust this to fit your specific setup!
内容的提问来源于stack exchange,提问作者Greg Lowe
相关产品推荐
相关产品推荐

