How do you decrease navbar height in Bootstrap 3?

前端 未结 9 934
终归单人心
终归单人心 2020-12-07 10:56

I want to make my navbar in BS3 to be of height 20px. How do I do this?

I\'ve tried the following:

.tnav .navbar .container { height: 28px; }
         


        
9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 11:28

    Minder Saini's example above almost works, but the .navbar-brand needs to be reduced as well.

    A working example (using it on my own site) with Bootstrap 3.3.4:

    .navbar-nav > li > a, .navbar-brand {
        padding-top:5px !important; padding-bottom:0 !important;
        height: 30px;
    }
    .navbar {min-height:30px !important;}
    

    Edit for Mobile... To make this example work on mobile as well, you have to change the styling of the navbar toggle like so

    .navbar-toggle {
         padding: 0 0;
         margin-top: 7px;
         margin-bottom: 0;
    }
    

提交回复
热议问题