Change bootstrap navbar collapse breakpoint without using LESS

前端 未结 19 2240
囚心锁ツ
囚心锁ツ 2020-11-22 07:55

Currently when the browser width drops below 768px, the navbar changes to collapsed mode. I want to change this width to 1000px so when the browser is below 1000px the navba

19条回答
  •  失恋的感觉
    2020-11-22 08:26

    In the Bootstrap 3 .LESS source code, there is a variable defined in variables.less called @grid-float-breakpoint which has the following helpful comment:

    //**Point at which the navbar becomes uncollapsed
    @grid-float-breakpoint: @screen-sm-min;
    

    The matching @grid-float-breakpoint-max value is set to that minus 1px:

    //**Point at which the navbar begins collapsing
    @grid-float-breakpoint-max: (@grid-float-breakpoint-max - 1);
    

    Solution:

    So just set the @grid-float-breakpoint value to 1000px instead and rebuild bootstrap.less into bootstrap.css:

    e.g.

    @grid-float-breakpoint: 1000px;
    

提交回复
热议问题