<!DOCTYPE html>
<html>
<head>
<link data-require="bootstrap-css@3.3.1" data-semver="3.3.1" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="form-group row flex-v-center">
<div class="col-xs-3 col-sm-2">
<label for="from">Valid from</label>
</div>
<div class="col-xs-3">
<p class="input-group">
<input type="text" id="from" class="form-control"/>
<span class="input-group-btn">
<button type="button" class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</p>
</div>
<div class="col-xs-1 text-center">
<label for="to">to</label>
</div>
<div class="col-xs-3">
<p class="input-group">
<input type="text" id="to" class="form-control"/>
<span class="input-group-btn">
<button type="button" class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</p>
</div>
</div>
<div class="form-group row flex-v-center">
<div class="col-xs-3 col-sm-2">
<label for="another-input">Another Element</label>
</div>
<div class="col-xs-3">
<input type="text" id="another-input" class="form-control"/>
</div>
</div>
</body>
</html>
body {
margin: 2em;
}
.flex-v-center {
display: flex;
align-items: center;
}
# Aligning bootstrap form elements in one line using bootstrap's grid
See http://paul.wellnerbou.de/2015/06/15/aligning-form-elements-in-one-line-using-bootstraps-grid/
Bootstrap's standard CSS for forms and inputs does support more than one input elements and labels in one line using [Bootstrap's CSS class form-inline](http://getbootstrap.com/css/#forms-inline).
The advantage of this approach over inline forms is the possibility to align input elements and their labels consistently over several lines at the same x-position. But you might (will) get more white space between your elements, especially on large screen, which you can avoid using inline forms.