"Bootstrap basic navbar with dropdown login form snippet"
Bootstrap 3.3.0 Snippet by shervs336

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <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="#">Brand Name</a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li class=""><a href="#">Home</a></li> <li class=""><a href="#">Locations</a></li> <li class=""><a href="#">About</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"> Sign In<span class="caret"></span> </a> <div class="dropdown-menu" id="formLogin"> <div class="row"> <div class="container-fluid"> <form> <div class="form-group"> <label>Username</label> <input class="form-control" name="username" id="username" type="text"> </div> <div class="form-group"> <label>Password</label> <input class="form-control" name="password" id="password" type="password"><br> </div> <button type="submit" id="btnLogin" class="btn btn-success btn-sm">Login</button> </form> </div> </div> </div> </li> <li><a href="#" data-toggle="modal" data-target='#modalRegister'>Register</a></li> </ul> </div><!--/.navbar-collapse --> </div> </nav>
/* CSS used here will be applied after bootstrap.css */ #formLogin{padding: 15px; min-width:300px;}

Related: See More


Questions / Comments: