JSFiddle - React, Tailwind, and code Playground
by Chris Rebert
HTML
<div class="floated">
<small>this floats fine</small>
<input class="form-control" placeholder="Search" type="text">
<input class="form-control" placeholder="Search" type="text">
</div>
<div class="floated">
<small>Floats only in Firefox (100% width elsewhere)</small>
<div class="input-group">
<input class="form-control" placeholder="Search" type="text">
<span class="input-group-btn">
<button class="btn btn-default" type="button">
Go
</button>
</span>
</div>
<div class="input-group">
<input class="form-control" placeholder="Search" type="text">
<span class="input-group-btn">
<button class="btn btn-default" type="button">
Go
</button>
</span>
</div>
</div>
CSS
.floated {
float: left;
padding: 5px;
border: 1px dashed #000;
}
.form-control {
display: block;
width: 100%;
}
.input-group {
position: relative;
display: table;
border-collapse: separate;
}
.input-group .form-control {
display: table-cell;
position: relative;
z-index: 2;
float: left;
width: 100%;
margin-bottom: 0;
}
.input-group-btn {
display: table-cell;
position: relative;
font-size: 0;
white-space: nowrap;
width: 1%;
vertical-align: middle;
}