"Horizontal Login Form in Navbar"
Bootstrap 3.1.0 Snippet by msurguy

<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.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 ----------> <div class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Sitename</a> </div> <center> <div class="navbar-collapse collapse" id="navbar-main"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Link</a> </li> <li><a href="#">Link</a> </li> <li><a href="#">Link</a> </li> <li><a href="#">Link</a> </li> <li><a href="#">Link</a> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="#">Action</a> </li> <li><a href="#">Another action</a> </li> <li><a href="#">Something else here</a> </li> <li class="divider"></li> <li><a href="#">Separated link</a> </li> <li class="divider"></li> <li><a href="#">One more separated link</a> </li> </ul> </li> </ul> <form class="navbar-form navbar-right" role="search"> <div class="form-group"> <input type="text" class="form-control" name="username" placeholder="Username"> </div> <div class="form-group"> <input type="text" class="form-control" name="password" placeholder="Password"> </div> <button type="submit" class="btn btn-default">Sign In</button> </form> </div> </center> </div> </div>

Related: See More


Questions / Comments:

This was great

Dilantha Prasanjith () - 8 years ago - Reply 0


Perfect thanks!!!

auk2 () - 9 years ago - Reply 0


Password should be type="password" and not type="text". Thanks for the template.

Bersling () - 9 years ago - Reply 0


is there in possibility to add label above each field and what about link for forget password?

allaghi () - 9 years ago - Reply 0


Hello +allagui, you can try inserting another button, like "Sign in" button, but insert it outside the <form> element, you will need to use JavaScript to redirect to password recovery page, or maybe you can try using a dialog / modal .
I think that is the best way .

acidmind_bh () - 8 years ago - Reply 0


Awesome Coding!!!
Thanks for this, it saved me tons o time!

Sabrina Brühwiler () - 10 years ago - Reply 0


this aved me time ... thanks :)

Karim Kawambwa () - 10 years ago - Reply 0


This was perfect. I couldn't quite get things to line up on my own. Thanks a bunch.

Doug Johnson () - 10 years ago - Reply 0


Thanks!!!! I was looking for this! Couldn't find how to align the form!

H.T () - 10 years ago - Reply 0


This saved me alot of work. Thak you.

Erick Alves () - 10 years ago - Reply 0


Awesome Collection! Thanks a ton

Rico J () - 10 years ago - Reply 0