Bootstrap 3 Navbar Collapse

后端 未结 12 2230
长发绾君心
长发绾君心 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:20

    I think I found a simple solution to changing the collapse breakpoint, only through css.

    I hope others can confirm it since I didn't test it thoroughly and I'm not sure if there are side effects to this solution.

    You have to change the media query values for the following class definitions:

    @media (min-width: BREAKPOINT px ){
        .navbar-toggle{display:none}
    }
    
    @media (min-width: BREAKPOINT px){
        .navbar-collapse{
            width:auto;
            border-top:0;box-shadow:none
        }
        .navbar-collapse.collapse{
            display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important
        }
        .navbar-collapse.in{
            overflow-y:visible
       }
       .navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{
            padding-left:0;padding-right:0
        }
    }
    

    This is what worked for me on my current project, but I still need to change some css definitions to arrange the menu properly for all screen sizes.

    Hope this helps.

提交回复
热议问题