The reason for this issue is the utilization of a media query within Bootstrap.
To resolve this problem, you should familiarize yourself with media queries. If you decide not to utilize media queries, refrain from using Bootstrap classes in navigation elements.
To rectify the situation, place the code inside @media (min-width: 768px) and (max-width: 979px).
.nav-collapse, .nav-collapse.collapse {
overflow: visible;
}
.navbar .btn-navbar {
display: none;
}
Alternatively,
You can prevent the navbar from stacking by adjusting the
@grid-float-breakpoint variable to 1px
Additionally,
Media queries are influenced by the browser width on mobile devices; you can tailor your styles using media query CSS.
@media(max-width:767px){}
@media(min-width:768px){}
@media(min-width:992px){}
@media(min-width:1200px){}
For more information on disabling media queries, refer to this link.