导航栏中导航栏下方的导航栏

时间:2016-04-29 08:43:54

标签: html css twitter-bootstrap css3

enter image description here

在图片中可以看到,有两个导航栏,一个带标题,另一个带菜单。它们不适合没有空间。我尝试过它。请协助。

<nav class="navbar top-color">
  <!--nav header Div-->
  <div class="container-fluid">
    <div class="col-sm-2"><a class="navbar-head" style="text-decoration:none; color:white;" href="#"><h1>MY Page</h1></a>
    </div>
  </div>
</nav>

<nav class="navbar navbar-inverse ">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span> 
      </button>
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Home</a></li>
        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" href="#">Page 1 <span class="caret"></span></a>
        </li>
        <li><a href="#">Page 2</a></li>
        <li><a href="#">Page 3</a></li>
      </ul>
    </div>
  </div>
</nav>

</body>

</html>
<style>
  .top-color {
    background-color: aquamarine;
  }
</style>

1 个答案:

答案 0 :(得分:3)

我认为您可以在此类中删除“margin-bottom”“.navbar.top-color”

.navbar.top-color {
  margin-bottom: 0;
}

请参阅BOOTPLY DEMO