When I resize the window to a medium size the two links on the right collapse and cause the navbar to take two rows even though there is enough space between the right links and the left links.
http://www.bootply.com/fthRQCpN7d
For navbars that never collapse, add the . navbar-expand class on the navbar. For navbars that always collapse, don't add any .
Add a padding of the size of your navbar's height to the body. Show activity on this post. Since 2017 add position: sticky; top:0; to navbar and it will fix this problem.
To create a fixed top menu, use position:fixed and top:0 .
You could write a @media-query to reduce the left/right padding when it hits the offending breakpoint:
@media(max-width:992px){
.nav>li>a {
padding-left: 10px;
padding-right:10px
}
}
May not work for every instance, but seems to for your example: http://www.bootply.com/fthRQCpN7d
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With