Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap navbar collapse media-query on custom width

Helo guys, I want to modify the navbar in order to collapse on @screen-md :992px;. I have modified navbar.less, but still not working and I don't know what to do.

So how can I modify the @grid-float-breakpoint variable in order to have that menu collapsed on custom media query size?

FIDDLE:

like image 826
BurebistaRuler Avatar asked Mar 11 '14 15:03

BurebistaRuler


People also ask

How do I stop bootstrap navbar from collapsing?

For navbars that never collapse, add the . navbar-expand class on the navbar. For navbars that always collapse, don't add any . navbar-expand class.


Video Answer


1 Answers

You can change the collapse point in 3.1 like this..

@media (max-width: 992px) {
    .navbar-header {
        float: none;
    }
    .navbar-left,.navbar-right {
        float: none !important;
    }
    .navbar-toggle {
        display: block;
    }
    .navbar-collapse {
        border-top: 1px solid transparent;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
    }
    .navbar-fixed-top {
        top: 0;
        border-width: 0 0 1px;
    }
    .navbar-collapse.collapse {
        display: none!important;
    }
    .navbar-nav {
        float: none!important;
        margin-top: 7.5px;
    }
    .navbar-nav>li {
        float: none;
    }
    .navbar-nav>li>a {
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .collapse.in{
        display:block !important;
    }
}

http://www.bootply.com/120951


In Bootstrap 4, changing the breakpoint is easier. See this answer

like image 137
Zim Avatar answered Oct 12 '22 13:10

Zim