【发布时间】:2016-11-13 07:24:31
【问题描述】:
请看下面的代码:
<div class="container">
<form class="form-inline" role="form">
<div class="form-group">
<label for="first">FIRST</label>
<input class="form-control" id="first" ng-model="???" ng-readonly="true" />
</div>
<div class="form-group">
<label for="second">SECOND</label>
<input class="form-control" id="second" ng-model="???" ng-readonly="true" />
</div>
<div class="form-group">
<label for="third">THIRD</label>
<input class="form-control" id="third" ng-model="???" ng-readonly="true" />
</div>
<div class="form-group">
<label for="fourth">FOURTH</label>
<input class="form-control" id="fourth" ng-model="???" ng-readonly="true" />
</div>
</form>
</div>
我的目的是在一行中创建一个包含 4 个元素的表单。 我根据这个例子写了这段代码:http://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_form_inline&stacked=h.
但是,我将这些元素中的每一个都放在了不同的行中。你知道为什么这个代码示例没有成功吗?
【问题讨论】:
-
它正在工作,它显示在一行中
-
它工作正常并显示在一行中..检查[jsfiddle.net/e88eqL0o
-
我认为你的窗口不够大,所以它会自动为不同的 div 添加行
-
问题可能是因为您的小视口或您的某些自定义样式已覆盖它
-
这是一个大型代码库的一部分。我写的代码 sn-p 放在以下标签内:
标签: html css angularjs forms angular-ui-bootstrap