Reputation: 3428
I'm trying to insert an icon next to an inout type was was able to do it using this code
<div class="form-group">
<label for="accountSpan">Account name</label>
<div class="input-group input-group-unstyled">
<span class="input-group-addon" id="accountSpan">something</span>
<input type="text" class="form-control" placeholder="account name" aria-describedby="basic-addon1" id="accountInput">
<span class="input-group-addon">
<i class="glyphicon glyphicon-question-sign"></i>
</span>
</div>
</div>
and this css
.input-group.input-group-unstyled input.form-control {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.input-group-unstyled .input-group-addon {
border-radius: 4px;
border: 0px;
background-color: transparent;
}
which I found in this thread Put search icon near textbox using bootstrap
But the given css changes the formating of the addon which results in
What is is I am missing? Thanks
Update
Removing background-color: transparent; will result in the addon having a border to
Upvotes: 0
Views: 1078
Reputation: 86
<div class="col-sm-4 input-group">
<input class="form-control">
<span class="input-group-btn">
<button class="btn btn-default"><i class="glyphicon glyphicon-search"></i>
</button>
</span> </div>
Upvotes: 3
Reputation: 41075
Just change your 2nd selector to
input-group-unstyled .input-group-addon:last-child {
...
Fiddle - https://jsfiddle.net/o1x3ubab/
Upvotes: 1