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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<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>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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 () - 10 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 () - 11 years ago - Reply 0