【发布时间】:2018-02-28 01:22:34
【问题描述】:
我正在尝试制作一个具有一些水平和内联字段的表单,找到了最好的方法,而不是与表单类作斗争,只是尝试像另一个常规模板一样做,我可以将标签和字段放在每个旁边其他但他们没有占用所有可能的空间,并且互相接触,我希望能够使用行的所有空间,
这就是我所拥有的: 谢谢大家
这是我想要消除的差距,我有点欺骗并使用 div 边距,但我认为这不是正确的方法 =(
<div class="col-lg-4" style="background-color:green">
<form>
<div class="form-group">
<div class="row">
<label for="name" class="control-label">Name</label>
</div>
<div class="row">
<input type="text" class="form-control" name="name" placeholder="name"/>
</div>
</div>
<br>
i want the birthday portion to be all one line all next to each other.
using all the space like the Name field above, should i use some kind of <span>?
<div class="form-group">
<div class="row">
<div class="col-lg-3">
<label for="birthday" class="control-label">Birthday:</label>
</div>
<div class="col-lg-3">
<input type="text" class="form-control" placeholder="year"/>
</div>
<div class="col-lg-3">
<input type="text" class="form-control" placeholder="month"/>
</div>
<div class="col-lg-3">
<input type="text" class="form-control" placeholder="day"/>
</div>
</div>
</div>
</form>
【问题讨论】:
-
您可能必须为此删除
col-*类上的填充。修改了答案以显示相同。
标签: javascript html css twitter-bootstrap