How to increase Bootstrap 3 Navbar height while keeping menu height small when collapsed

前端 未结 2 1941
余生分开走
余生分开走 2021-02-07 01:52

I am trying to increase the height of a top-fixed Bootstrap 3 navbar to 80px, but want to keep the original min-height at 50px, when the menu is collapsing (i.e. screen widths o

2条回答
  •  遇见更好的自我
    2021-02-07 02:15

    Your logic is backwards. Right now it'll only apply that 50px height for pages WIDER than 768px. This should fix it:

    .navbar-fixed-top {
        min-height: 80px;
    }
    
    .navbar-fixed-top .navbar-collapse {
        max-height: 80px;
    }
    
    @media (min-width: 768px) {
        .navbar-fixed-top .navbar-collapse {
            max-height: 50px;
        }
    }
    

提交回复
热议问题