1
You can use the class input-group-addon
to do as you wish.
See the low example:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="form-group">
<div class="input-group">
<span class="input-group-addon">
<i class="glyphicon glyphicon-calendar"></i>
</span>
<input class="form-control left-border-none" type="text" placeholder="Ida" />
</div>
</div>
<form class="form-inline">
<div class="form-group">
<label class="sr-only" for="exampleInputAmount">Amount (in dollars)</label>
<div class="input-group">
<div class="input-group-addon">$</div>
<input type="text" class="form-control" id="exampleInputAmount" placeholder="Amount">
<div class="input-group-addon">.00</div>
</div>
</div>
</form>
Just remembering that the element
button
has, by default,tabindex
equal to 0 and enters the navigation list by keyboard. In this case, as it will be merely decorative, it is interesting to definetabindex="-1"
so that the focus is passed directly to theinput
. Further reading: How and where tabindex works?. Use semanticallyinput-group-addon
, as specified in the other answer, makes more sense.– Woss