Bootstrap 3 navbar-fixed-top stay fixed in mobile view
.navbar-fixed-top
keeps the navbar fixed top for all screen sizes now. This will be the default. When you take a look at navbar.less you will see no media queries are applied on this class too.
To make the navbar static after the collapse add the css shown below after the Boostrap CSS:
@media (max-width: 767px) /* @grid-float-breakpoint -1 */
{
.navbar-fixed-top
{
position: relative;
top: auto;
}
}
Additionally to what Bass Jobsen has mentioned, for a better usability on mobile, the following CSS snippet removes the "sub-scrolling" on the navigation bar and removes the top margin which is there due to the large screen fixed navbar:
@media (max-width: 767px) {
.navbar-fixed-top {
position: relative;
top: auto;
}
.navbar-collapse {
max-height: none;
}
body {
margin: 0;
}
}