在我的 webapp 项目中,我使用 Bootstrap 作为前端框架。还有一个问题让我感到困惑。HTML 代码如下:
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="control-label col-lg-2" for="candidatecity">Cities</label>
<div class="col-lg-2">
<select class="form-control" ng-options="city for city in avaiablecities" ng-model="selectedCity" id="candidatecity" ></select>
</div>
<div class="input-group col-lg-2">
<span class="input-group-addon glyphicon glyphicon-search"></span><input type="text" class="form-control" id="searchcity" placeholder = "Search City">
</div>
<label class="control-label col-lg-2" for="period">Time Period</label>
<div class="col-lg-2">
<select class="form-control" ng-options="period for period in avaiableperiod" ng-model="selectedperiod" id="period"></select>
</div>
<div class="col-lg-2">
<button type="submit" class="btn btn-default" ng-click="clickSendRequest()">Get Data</button>
</div>
</div>
</form>
令人困惑的一点是所有列的宽度加起来只有12,这符合网格系统规则。但是为什么不能将这些组件放在一行中呢?