How do you decrease navbar height in Bootstrap 3?

前端 未结 9 930
终归单人心
终归单人心 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:42

    In Bootstrap 4

    In my case I have just changed the .navbar min-height and the links font-size and it decreased the navbar.

    For example:

    .navbar{
        min-height:12px;
    }
    .navbar  a {
        font-size: 11.2px;
    }
    

    And this also worked for increasing the navbar height.

    This also helps to change the navbar size when scrolling down the browser.

    0 讨论(0)
  • 2020-12-07 11:42

    Simply change the default 50px navbar-height by including this to your variable overrides.

    You can find this default navbar-height on line 365 and 360 on bootstrap's SASS and LESS variables files respectively.

    File location, SASS: bootstrap/assets/stylesheets/bootstrap/_variables.scss

    File location, LESS: bootstrap/less/variable.less

    0 讨论(0)
  • 2020-12-07 11:43
     .navbar-nav > li > a {padding-top:7px !important; padding-bottom:7px !important;}
    .navbar {min-height:32px !important;} 
    .navbar-brand{padding-top:7px !important; max-height: 24px;  }
    .navbar .navbar-toggle {  margin-top: 0px; margin-bottom: 0px; padding: 8px 9px; }
    
    0 讨论(0)
提交回复
热议问题