"Login in a panel"
Bootstrap 3.2.0 Snippet by PrasadPhule

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.2.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.2.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="container" style="margin-top:30px">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title"><strong>Sign In </strong></h3></div>
<div class="panel-body">
<form role="form">
<div class="form-group">
<label for="exampleInputEmail1">Username or Email</label>
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password <a href="/sessions/forgot_password">(forgot password)</a></label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<button type="submit" class="btn btn-sm btn-default">Sign in</button>
</form>
</div>
</div>
</div>
<div class="col-md-4">
<div class="login-panel panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Sign In</h3>
</div>
<div class="panel-body">
<form role="form">
<fieldset>
<div class="form-group">
<input class="form-control" placeholder="E-mail" name="email" type="email" autofocus="">
</div>
<div class="form-group">
<input class="form-control" placeholder="Password" name="password" type="password" value="">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments:

Great snippet, good use of built in Bootstrap CSS so it's not necessary to add a bunch of lines to the main.css. Thanks!

Tryforce () - 8 years ago - Reply 0


I thought that I'd just mention that if you use `type="email"` on the Username / email field, you cannot enter a username as in new browsers, you will be asked to enter a valid email address. Just sayin' :)

Connor Gurney () - 10 years ago - Reply 0


What do I need to add to the project ?

ibrahim () - 10 years ago - Reply 0


What do you mean?

maxsurguy () - 10 years ago - Reply 0


Where is CSS?

Maxim Gorokhovich () - 10 years ago - Reply 0


This snippet only requires Bootstrap CSS to be loaded, nothing else. You can get Bootstrap at http://getbootstrap.com. Enjoy!

maxsurguy () - 10 years ago - Reply 0