Bill Noble
Bill Noble

Reputation: 6744

Bootstrap - Bottom align menu in navbar

I need to align the menu text with the bottom of the Bootstrap 3 navbar.

My code is:

    <nav class="navbar navbar-default">
      <div class="container">
        <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>
                <span class="icon-bar"></span>
           </button>
         <a class="navbar-brand" href="#"><img class="img-responsive" src="/assets/img/outa.png" width="120px;"/></a>
        </div>
        <div class="collapse navbar-collapse" id="myNavbar">
          <ul class="nav navbar-nav pull-right">
              <li><a href="/browser/saved/">Saved searches</a></li>
              <li><a href="../index.html">Settings</a></li>
              <li><a href="../index.html">About</a></li>
              <li><a href="../index.html">Sign In</a></li>
          </ul>
        </div>
      </div>
    </nav>

This centers the menu vertically in the shaded navbar. Is it possible to change this so that the menu lies 4px above the bottom of the shaded navbar area?

Upvotes: 3

Views: 16226

Answers (1)

S.Visser
S.Visser

Reputation: 4725

This should do the trick.

#myNavbar {
    position: relative;
}

#myNavbar .nav {
    position: absolute; 
    bottom: 0; 
    right: 0;
    margin-bottom: -10px;
}

JSFiddle

Upvotes: 1

Related Questions