我正在以这种方式使用UI Bootstrap中的datepicker:
<div class="form-group">
<label class="col-lg-3 control-label">Birth Date:</label>
<div class="col-lg-8">
<input type="text"
class="form-control"
datepicker-popup="MMMM dd, yyyy"
ng-model="panels.patient.birthDate"
is-open="pdfc.opened"
ng-required="true"
close-text="Close" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="pdfc.open()"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</div>
</div>
该按钮以新行显示,就像有<br />
一样。有没有办法像these examples中那样在<input />
的同一行显示按钮?
答案 0 :(得分:1)
设置input-group
而不是form-group
<强> HTML 强>
<label class="col-lg-3 control-label">Birth Date:</label>
<div class="col-lg-8">
<div class="input-group">
<input type="text"
class="form-control"
datepicker-popup="MMMM dd, yyyy"
ng-model="panels.patient.birthDate"
is-open="pdfc.opened"
ng-required="true"
close-text="Close" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="pdfc.open()"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</div>
<强> DEMO HERE 强>
答案 1 :(得分:0)
只需将输入的显示设置为“内联块”
即可CSS:
.form-group input {
display: inline-block;
}