Edit This Code:
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Case</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>

<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="tryit.asp-filename=trybs_ref_js_dropdown_login&stacked=h.html#">WebSiteName</a>
    </div>
    <div>
      <ul class="nav navbar-nav">
        <li class="active"><a href="tryit.asp-filename=trybs_ref_js_dropdown_login&stacked=h.html#">Home</a></li>
        <li><a href="tryit.asp-filename=trybs_ref_js_dropdown_login&stacked=h.html#">Page 1</a></li>
        <li><a href="tryit.asp-filename=trybs_ref_js_dropdown_login&stacked=h.html#">Page 2</a></li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
        <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="tryit.asp-filename=trybs_ref_js_dropdown_login&stacked=h.html#">Login <span class="glyphicon glyphicon-log-in"></span></a>
          <div class="dropdown-menu">
            <form id="formLogin" class="form container-fluid">
              <div class="form-group">
                <label for="usr">Name:</label>
                <input type="text" class="form-control" id="usr">
              </div>
              <div class="form-group">
                <label for="pwd">Password:</label>
                <input type="password" class="form-control" id="pwd">
              </div>
              <button type="button" id="btnLogin" class="btn btn-block">Login</button>
            </form>
            <div class="container-fluid">
              <br>
              <a class="small" href="tryit.asp-filename=trybs_ref_js_dropdown_login&stacked=h.html#">Forgot password?</a>
            </div>         
          </div>
        </li>
      </ul>
    </div>
  </div>
</nav>
  
<div class="container">
  <h3>Navbar With Dropdown</h3>
  <p>This example adds a dropdown menu for the "Login" button in the navigation bar.</p>
</div>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy