"Pure-CSS Float Label (v3)"
Bootstrap 3.3.0 Snippet by tonystar

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="//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 ---------->
<div style="padding: 3rem 1rem">
<form class="well center-block" style="max-width: 35rem">
<legend class="text-center">Sign up</legend>
<div class="form-group input-group">
<span class="has-float-label">
<input class="form-control" id="first" type="text" placeholder="Name"/>
<label for="first">First</label>
</span>
<span class="has-float-label">
<input class="form-control" id="last" type="text" placeholder="Surname"/>
<label for="last">Last</label>
</span>
</div>
<div class="form-group input-group">
<span class="input-group-addon">@</span>
<span class="has-float-label">
<input class="form-control" id="email" type="email" placeholder="box@example.com"/>
<label for="email">Email</label>
</span>
</div>
<div class="form-group has-float-label">
<input class="form-control" id="password" type="password" placeholder="••••••••"/>
<label for="password">Password</label>
</div>
<div class="form-group has-float-label">
<select class="form-control" id="country">
<option selected>United States</option>
<option>Canada</option>
<option>...</option>
</select>
<label for="country">Country</label>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
@import "https://cdn.rawgit.com/tonystar/bootstrap-float-label/v3.0.0/dist/bootstrap-float-label.css";
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
// No JS!
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: