Bootstrap 3 Navbar Collapse

后端 未结 12 2268
长发绾君心
长发绾君心 2020-11-22 09:27

Is there any way to increase the point at which the bootstrap 3 navbar collapses (i.e. so that it collapses into a drop down on portrait tablets)?

These two were app

12条回答
  •  忘掉有多难
    2020-11-22 10:13

    these are controlled in variables, no need to muck around in source. with bootstrap, try variables first, then overrides. then go back and try variables again ;)

    i used bootstrap-sass with rails, but it's the same with the default LESS.

    FILE: main.css.scss
    -------------------
    
    // control the screen sizes
    $screen-xs-min: 300px;
    $screen-sm-min: 400px;
    $screen-md-min: 800px;
    $screen-lg-min: 1200px;
    
    // this tells which screen size to use to start breaking on
    // will tell navbar when to collapse
    $grid-float-breakpoint: $screen-md-min;
    
    // then import your bootstrap
    @import "bootstrap";
    

    that's it! this variables reference page is super handy: https://github.com/twbs/bootstrap/blob/master/less/variables.less

提交回复
热议问题