Bootstrap 3 Navbar Collapse

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

    If the problem you face is the menu breaking into multiple lines, you can try one of the following:

    1) Try to reduce the number of menu items or their length, like removing menu items or shortening the words.

    2) Reducing the padding between the menu items, like this:

    .navbar .nav > li > a {
    padding: 10px 15px 10px; /* Change here the second value for padding-left and padding right */
    }
    

    Default padding is 15px both sides (left and right).

    If you prefer to change each individual side use:

    padding-left: 7px; 
    padding-right: 8px;
    

    This setting affects the dropdown list too.

    This doesn't answer the question but it could help others who don't want to mess with the CSS or using LESS variables. The two common approaches to solve this problem.

提交回复
热议问题