I am developing a page in which I have both sidebar
as well as navbar
I have to make my navbar fix to the top so that it is a better user experience.
Issue
But when I am using inbuilt fixed-top
bootstrap class it is overriding the sidebar, my navbar
starts after the width of sidebar,
So I just want to make that fixed at the top so that scrolling becomes easier
My navbar code
<div>
<Navbar collapseOnSelect expand="lg" className="py-3 navbar_style">
<Navbar.Toggle aria-controls="responsive-navbar-nav" />
<Navbar.Collapse id="responsive-navbar-nav">
<Nav className="mr-auto"></Nav>
<Nav>
<Nav.Link href="#deets">Logout</Nav.Link>
</Nav>
</Navbar.Collapse>
</Navbar>
</div>
Side bar CSS
.sidebar {
height: 100%;
width: 100px;
position: fixed;
top: 0;
left: 0;
transition: all 0.6s;
background: #ffffff 0% 0% no-repeat padding-box;
box-shadow: 0px 3px 6px #00000029;
opacity: 1;
}
I have written the minimal code in sandbox, I just want to fix navbar to the top without overriding my sidebar, please check the code sandbox