如何更改bootstrap导航栏高度?

时间:2016-07-28 18:31:35

标签: navbar

我想在bootstrap中更改导航栏的高度。我的代码:

         <nav class="navbar navbar-inverse">
      <div class="container-fluid">
        <div class="navbar-header">
          <div class="navbar-brand">MyDatoo</div>
        </div>
        <ul class="nav navbar-nav">
          <li><a href="#">Home</a></li>
          <li><a href="#">Page 1</a></li>
          <li><a href="#">Page 2</a></li>
        </ul>
        <ul class="nav navbar-nav navbar-right">
          <li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
          <li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
        </ul>
      </div>
    </nav>

我想更改此导航栏高度: enter image description here

2 个答案:

答案 0 :(得分:2)

.navbar {
    height: 100px !important; /*i assume your navbar size 100px*/
}

如果您处理移动

@media only screen and (min-width: 600px) {
   .navbar {
    height: 100px !important; 
   }
}
@media only screen and (min-width: 768px) {
   .navbar {
    height: 120px !important; 
  } 
}

答案 1 :(得分:0)

您可以添加此css

.navbar {
    height: YOUR_SIZE !important;
}