Skip to content

Instantly share code, notes, and snippets.

@fauverism
Created January 27, 2015 15:29
Show Gist options
  • Save fauverism/3f97b79dbf2ab0c5502a to your computer and use it in GitHub Desktop.
Save fauverism/3f97b79dbf2ab0c5502a to your computer and use it in GitHub Desktop.
Change the width of the bootstrap navbar to always remain collapsed, unless the viewport is over 2048px
@media (max-width: 2048px) {
.navbar-header {
float: none;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.navbar-collapse.collapse {
display: none!important;
}
.navbar-nav {
float: none!important;
margin: 7.5px -15px;
}
.navbar-nav>li {
float: none;
}
.navbar-nav>li>a {
padding-top: 10px;
padding-bottom: 10px;
}
/* since 3.1.0 */
.navbar-collapse.collapse.in {
display: block!important;
}
.collapsing {
overflow: hidden!important;
}
}
@jtw3850
Copy link

jtw3850 commented May 20, 2015

Once you open it, you can't close it back. Also the text will get a little off when you do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment