"Support glyph and fa icon inside input"
Bootstrap 3.1.0 Snippet by imjohnlouie

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="container">
<div class="row" style="margin-top: 5%">
<div class="col-md-5">
<div class="form-group">
<div class="icon-addon addon-lg">
<input type="text" placeholder="Email" class="form-control" id="email">
<label for="email" class="glyphicon glyphicon-search" rel="tooltip" title="email"></label>
</div>
</div>
<div class="form-group">
<div class="icon-addon addon-md">
<input type="text" placeholder="Email" class="form-control" id="email">
<label for="email" class="glyphicon glyphicon-search" rel="tooltip" title="email"></label>
</div>
</div>
<div class="form-group">
<div class="icon-addon addon-sm">
<input type="text" placeholder="Email" class="form-control" id="email">
<label for="email" class="glyphicon glyphicon-search" rel="tooltip" title="email"></label>
</div>
</div>
<div class="form-group">
<div class="icon-addon addon-lg">
<select class="form-control">
<option>Select Option</option>
<option>Sample</option>
<option>Sample</option>
</select>
<label for="email" class="glyphicon glyphicon-search" rel="tooltip" title="email"></label>
</div>
</div>
<div class="form-group">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
.center-block {
float: none;
margin-left: auto;
margin-right: auto;
}
.input-group .icon-addon .form-control {
border-radius: 0;
}
.icon-addon {
position: relative;
color: #555;
display: block;
}
.icon-addon:after,
.icon-addon:before {
display: table;
content: " ";
}
.icon-addon:after {
clear: both;
}
.icon-addon.addon-md .glyphicon,
.icon-addon .glyphicon,
.icon-addon.addon-md .fa,
.icon-addon .fa {
position: absolute;
z-index: 2;
left: 10px;
font-size: 14px;
width: 20px;
margin-left: -2.5px;
text-align: center;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments:

the icon inside the select input is overlapped by text when using chrome in Mac OS. Could you please check it!

bitdealo () - 9 years ago - Reply 0


Strange for some reason it is ignoring body font-family completely and showing Times Roman, even though it is not in css!

ukmartyn () - 10 years ago - Reply 0


Try !important in your css!

Adrian () - 8 years ago - Reply 0


i am not able to select text inside the input using mouse ?

Vivek () - 10 years ago - Reply 0


Thanks ;-)

Behzad () - 10 years ago - Reply 0


welcome Behzad ;-)

John Louie Binas () - 10 years ago - Reply 0


Hi, I loved your hack.
Tell me, please, how you can make a script that he would ignore some columns in the table? Not looking for these columns. Thank you.

Denis () - 11 years ago - Reply 0


John Louie Binas () - 11 years ago - Reply 0