NextIndexPrevious

Programs in Bootstrap

6. Bootstrap navbar example.

<html>
<head>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<script src="js/jquery.min.js"></script>
</head>
<body>

<nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
       data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Logo</a>
    </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Item 1 <span class="sr-only">(current)</span></a></li>
        <li><a href="#">Item 2</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
           aria-expanded="false">Item 3 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#">Sub-item 1</a></li>
            <li><a href="#">Sub-item 2</a></li>
            <li><a href="#">Sub-item 3</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Sub-item 4</a></li>
            
          </ul>
        </li>
      </ul>
    </div>
  </div>
</nav>

<br /><br />

<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" 
      data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Logo</a>
    </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Item 1 <span class="sr-only">(current)</span></a></li>
        <li><a href="#">Item 2</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" 
          aria-expanded="false">Item 3 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#">Sub-item 1</a></li>
            <li><a href="#">Sub-item 2</a></li>
            <li><a href="#">Sub-item 3</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Sub-item 4</a></li>
            
          </ul>
        </li>
      </ul>
    </div>
  </div>
</nav>

<script src="js/bootstrap.min.js"></script>
</body>
</html>

Output :





Father of JavaScript


Brendan Eich

Brendan Eich

Born: 1961, Pennsylvania
Google+