Priyoshika Ram
Priyoshika Ram

Reputation: 53

nav bar below nav bar in bootstrap

enter image description here

In the picture you can see , there are two navbar , one with header and othe with menus. They doesn't fit without space. I tried working on it. Please assist.

<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>

Upvotes: 2

Views: 5588

Answers (1)

Jainam
Jainam

Reputation: 2660

I think you can just remove "margin-bottom" in this class ".navbar.top-color"

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

See BOOTPLY DEMO

Upvotes: 4

Related Questions