For inputs smallers:
.input-xs {
height: 22px;
padding: 2px 5px;
font-size: 12px;
line-height: 1.5; /* If Placeholder of the input is moved up, rem/modify this. */
border-radius: 3px;
}
Sample usage in input-group:
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-xs btn-success">
<i class="glyphicon glyphicon-plus"></i>
</button>
</span>
<input type="text" class="form-control input-xs" />
<span class="input-group-btn">
<button class="btn btn-xs btn-danger">
<i class="glyphicon glyphicon-minus"></i>
</button>
</span>
</div>
Alternatively you can add class to the input-group like this one:
.input-group-xs>.form-control,
.input-group-xs>.input-group-addon,
.input-group-xs>.input-group-btn>.btn {
height: 22px;
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
}
and use:
<div class="input-group input-group-xs">
<span class="input-group-btn">
<button class="btn btn-success">
<i class="glyphicon glyphicon-plus"></i>
</button>
</span>
<input type="text" class="form-control" />
<span class="input-group-btn">
<button class="btn btn-danger">
<i class="glyphicon glyphicon-minus"></i>
</button>
</span>
</div>
.input-xs {
height: 22px!important;
padding: 2px 5px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.input-group-xs>.form-control,
.input-group-xs>.input-group-addon,
.input-group-xs>.input-group-btn>.btn {
height: 22px;
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-xs btn-success">
<i class="glyphicon glyphicon-plus"></i>
</button>
</span>
<input type="text" class="form-control input-xs" />
<span class="input-group-btn">
<button class="btn btn-xs btn-danger">
<i class="glyphicon glyphicon-minus"></i>
</button>
</span>
</div>
<br/>
<div class="input-group input-group-xs">
<span class="input-group-btn">
<button class="btn btn-success">
<i class="glyphicon glyphicon-plus"></i>
</button>
</span>
<input type="text" class="form-control" />
<span class="input-group-btn">
<button class="btn btn-danger">
<i class="glyphicon glyphicon-minus"></i>
</button>
</span>
</div>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…