Darren Darren - 1 year ago 136
CSS Question

Bootstrap 3 - show collapsed navigation for all screen sizes

I am using Bootstrap v3.

I have the navbar classes in place so that when I have my screen mobile-size the navigation collapses and the little grid-like toggle button appears - so this is working as expected.

what i would like, is for this to be the default action for all screen sizes. That is, even on a desktop I would like the navigation to be collapsed and the toggle button to be visible.

I've had a look through the css and there is a whole bunch of stuff that provides the functionality, though I don't know which parts to change.

I've tried commenting out the larger media-queries, though there are a lot of them and it seems to have a knock-on effect to other styling.

any ideas?

Answer Source

You can use override the default Bootstrap CSS like this...

    .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;

Demo: http://www.bootply.com/114896

This will ensure that the collapsed navbar is always used by overriding the Bootstrap @media queries.