Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a Search icon in the end of a input-group IN bootstrap 3

Forms have changed since 2.4.3 and This would have worked before but not anymore.

This is the current code I have for my search bar.

<li>
   <div class="input-group" id="fifteenMargin">
      <input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term">
   </div>
</li>

This is what it currently looks like.

enter image description here

I would like it to eventually look like this.

enter image description here

Although this question is close this to this one its different as that is just having a button on the outside without space between the two. This is how to get it into the search bar.

like image 994
Jack Avatar asked Oct 08 '13 19:10

Jack


2 Answers

Try this..

.input-group-btn > .btn {
  border-left-width:0;left:-2px;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.input-group .form-control:focus {
 box-shadow:none;
 -webkit-box-shadow:none; 
 border-color:#cccccc; 
}

You may want to use a special CSS class instead of overriding all of the input-groups

Demo: http://bootply.com/86446

like image 130
Zim Avatar answered Oct 12 '22 23:10

Zim


try

<div class="input-group">
    <span class="input-group-addon">
        <i class="glyphicon glyphicon-user"></i>
    </span>
    <input type="text" name="login" class="form-control" placeholder="Ваш логин">
</div>
like image 38
Ivan Avatar answered Oct 12 '22 21:10

Ivan