【发布时间】:2017-12-25 03:24:50
【问题描述】:
有谁知道这种事情是否可行?
我尝试过使用 inline-group 和 form-inline 但它似乎不符合整个网格宽度。
而 form-horizontal 似乎希望整个表单都在一行中。
此代码创建所需的输出(一行上有两个表单控件),但每个表单都需要表单组,以便在 sm 模式下查看。
注意:这是针对 16 列网格的。
<form>
<div className="form-group row">
<!--form group needed here -->
<label className="col-form-label col-md-2" htmlFor="formGroupExampleInput">First Name*</label>
<div className="col-md-5">
<input type="text" className="form-control" id="formGroupExampleInput" placeholder="Example input" />
</div>
<!--form group needed here -->
<label className="offset-md-2 col-form-label col-md-2" htmlFor="formGroupExampleInput">Last Name*</label>
<div className="col-md-5">
<input type="text" className="form-control" id="formGroupExampleInput" placeholder="Example input" />
</div>
</div>
</form>
我不认为这是重复的: Bootstrap 3: How to get two form inputs on one line and other inputs on individual lines?
...因为这不会让我通过表单标签等完全控制网格列。
【问题讨论】:
-
可能重复Bootstrap 3: How to get two form inputs on one line and other inputs on individual lines? 关于表单输入的问题,但是关于表单组的解决方案。
-
使用这种方法似乎无法控制列????
标签: html forms twitter-bootstrap-4