我在 HTML 中有以下代码:
<div class="col-sm-12">
<div ng-repeat="param in plugin.wsdlURLs track by $index" class="col-sm-12">
<select class="form-control col-sm-4" ng-model="test" ng-options="lOrU for lOrU in localOrUrl">
</select>
<input type="url" class="form-control col-sm-8 invalidInput">
</div>
</div>
我遇到了一个问题,当我放置一个 form-control
类时,它会在一行中显示 select
,在一行中显示 input
另一排。
我想保留 form-control
类,并在同一行中显示 select
和 input
。
我知道问题出在 form-control
,因为宽度是 100%
最佳答案
好吧,您在彼此内部嵌套了很多 col-sm
列,这会导致一团糟。
试试这个:
<div ng-repeat="param in plugin.wsdlURLs track by $index" class="row">
<div class="col-sm-4">
<select class="form-control" ng-model="test" ng-options="lOrU for lOrU in localOrUrl">
</select>
</div>
<div class="col-sm-8">
<input type="url" class="form-control col-sm-8 invalidInput">
</div>
</div>
关于css - 如何修复表单控件的宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24117114/