From 768px to 992px the burger and nav-links are both displaying. I notice if I change the media query from bootstrap to 992px, it seems to fix this issue. If I try adding this breakpoint to my code with the with at 992px, it does nothing.
That’s because the .navbar-expand-lg class should be .navbar-expand-md also no need to use that media query I suppose… that class suffix controls thebreakpoint at wich the nav items are displayd, idem for the hamburguer. Hope it helps.
Thanks that fixed it. Do you have a link to some documentation explaining this in more detail? I don’t quite understand why navbar-expand-lg displays both the burger and nav-links.
Because:
1: .navbar-expand-lg makes the nav links appear from large screen (lg breakpoint) and up, and at the same time it hides the nav links for lower screens while displaying the hamburger menu.
2. Using your media query overrides the above behavior. While .navbar-expand-lg hides the nav links and displays the hamburger, with the media query you are forcing to display the nav links, overriding it, and causing to display both. So bottom line only use .navbar-expand-{breakpoint} without any @media query.
I wasn’t actually using any media query at all. I only noticed that breakpoint from inspecting the page. I then tried changing the breakpoint via inspect and it seemed to fix the issue. I hope I’m making some sense.
Alright, suspicions confirmed then. Okey I’m not sure you can change the breakpoint really like that, I would have to check a website with B3, if u can make a codepen I can take a look at it