Bs Navbar

Bootstrap Navigation Bar


Navigation Bars

Influenza A virus subtype H5N1 navigation bar is a navigation header that is placed at the elevation of the page:
With Bootstrap, a navigation bar tin extend or collapse, depending on the covert size.
Influenza A virus subtype H5N1 criterion navigation bar is created alongside <nav class="navbar navbar-default">.
The next event shows how to add together a navigation bar to the elevation of the page:

Example

<nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <ul class="nav navbar-nav">
      <li class="active"><a href="#">Home</a></li>
      <li><a href="#">Page 1</a></li>
      <li><a href="#">Page 2</a></li>
      <li><a href="#">Page 3</a></li>
    </ul>
  </div>
</nav>
...
Note: All of the examples on this page volition exhibit a navigation bar that takes upward equally good much infinite on pocket-size screens (however, the navigation bar volition last on ane unmarried describe of piece of work on large screens - because Bootstrap is responsive). This employment (with the pocket-size screens) volition last solved inward the final event on this page.

Inverted Navigation Bar

If yous don't similar the fashion of the default navigation bar, Bootstrap provides an alternative, dark navbar:
Just modify the .navbar-default course of report into .navbar-inverse:

Example

<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <ul class="nav navbar-nav">
      <li class="active"><a href="#">Home</a></li>
      <li><a href="#">Page 1</a></li>
      <li><a href="#">Page 2</a></li>
      <li><a href="#">Page 3</a></li>
    </ul>
  </div>
</nav>

Navigation Bar With Dropdown

Navigation bars tin also tally dropdown menus.
The next event adds a dropdown card for the "Page 1" button:

Example

<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <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>
        <ul class="dropdown-menu">
          <li><a href="#">Page 1-1</a></li>
          <li><a href="#">Page 1-2</a></li>
          <li><a href="#">Page 1-3</a></li>
        </ul>
      </li>
      <li><a href="#">Page 2</a></li>
      <li><a href="#">Page 3</a></li>
    </ul>
  </div>
</nav>

Right-Aligned Navigation Bar

The .navbar-right course of report is used to right-align navigation bar buttons.
In the next event nosotros insert a "Sign Up" push in addition to a "Login" push to the correct inward the navigation bar. We also add together a glyphicon on each of the 2 novel buttons:

Example

<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <ul class="nav navbar-nav">
      <li class="active"><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>

Navbar Buttons

To add together buttons within the navbar, add together the .navbar-btn course of report on a Bootstrap button:

Example

<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <ul class="nav navbar-nav">
      <li class="active"><a href="#">Home</a></li>
      <li><a href="#">Link</a></li>
      <li><a href="#">Link</a></li>
    </ul>
    <button class="btn btn-danger navbar-btn">Button</button>
  </div>
</nav>

Navbar Forms

To add together shape elements within the navbar, add together the .navbar-form course of report to a shape chemical ingredient in addition to add together an input(s). Note that nosotros receive got added a .form-group course of report to the div container belongings the input. This adds proper padding if yous receive got to a greater extent than than ane inputs (you volition larn to a greater extent than most this inward the Forms chapter).

Example

<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <ul class="nav navbar-nav">
      <li class="active"><a href="#">Home</a></li>
      <li><a href="#">Page 1</a></li>
      <li><a href="#">Page 2</a></li>
    </ul>
    <form class="navbar-form navbar-left">
      <div class="form-group">
        <input type="text" class="form-control" placeholder="Search">
      </div>
      <button type="submit" class="btn btn-default">Submit</button>
    </form>
  </div>
</nav>
You tin also purpose the .input-group in addition to .input-group-addon classes to attach an paradigm or assistance text adjacent to the input field. You volition larn to a greater extent than most these classes inward the Bootstrap Inputs chapter.

Example

<form class="navbar-form navbar-left">
  <div class="input-group">
    <input type="text" class="form-control" placeholder="Search">
    <div class="input-group-btn">
      <button class="btn btn-default" type="submit">
        <i class="glyphicon glyphicon-search"></i>
      </button>
    </div>
  </div>
</form>

Navbar Text

Use the .navbar-text course of report to vertical align whatever elements within the navbar that are non links (ensures proper padding in addition to text color).

Example

<nav class="navbar navbar-inverse">
  <ul class="nav navbar-nav">
    <li><a href="#">Link</a></li>
    <li><a href="#">Link</a></li>
  </ul>
  <p class="navbar-text">Some text</p>
</nav>

Fixed Navigation Bar

The navigation bar tin also last fixed at the elevation or at the bottom of the page.
Influenza A virus subtype H5N1 fixed navigation bar stays visible inward a fixed order (top or bottom) independent of the page scroll.
The .navbar-fixed-top course of report makes the navigation bar fixed at the top:

Example

<nav class="navbar navbar-inverse navbar-fixed-top">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <ul class="nav navbar-nav">
      <li class="active"><a href="#">Home</a></li>
      <li><a href="#">Page 1</a></li>
      <li><a href="#">Page 2</a></li>
      <li><a href="#">Page 3</a></li>
    </ul>
  </div>
</nav>
The .navbar-fixed-bottom course of report makes the navigation bar remain at the bottom:

Example

<nav class="navbar navbar-inverse navbar-fixed-bottom">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <ul class="nav navbar-nav">
      <li class="active"><a href="#">Home</a></li>
      <li><a href="#">Page 1</a></li>
      <li><a href="#">Page 2</a></li>
      <li><a href="#">Page 3</a></li>
    </ul>
  </div>
</nav>

Collapsing The Navigation Bar

The navigation bar oftentimes takes upward equally good much infinite on a pocket-size screen.
We should cover the navigation bar; in addition to exclusively exhibit it when it is needed.
In the next event the navigation bar is replaced yesteryear a push inward the elevation correct corner. Only when the push is clicked, the navigation bar volition last displayed:

Example

<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><a href="#">Page 1</a></li>
        <li><a href="#">Page 2</a></li>
        <li><a href="#">Page 3</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>
  </div>
</nav>

     

Comments

Popular posts from this blog

What Are The Main Components of a Computer System

Top Qualities To Look For In An IT Support Team

How To Integrate Google Adwords Api Into Codeigniter?