Bootstrap如何在多个字段中添加帮助块形成组

时间:2017-07-22 01:31:00

标签: twitter-bootstrap twitter-bootstrap-3

您好我的Bootstrap表单中包含以下代码:

<div class="form-group">
   <label class="col-md-3 control-label">Width / Height</label>
   <div class="col-md-4">
      <input type="text" class="form-control" name="Width" value="" required>
   </div>
   <div class="col-md-4">
      <input type="text" class="form-control" name="Height" value="" required>
   </div>
   <span class="help-block"><small>A block of help text that breaks onto a new line and may extend beyond one line.</small></span>
</div>

输出是这样的:

enter image description here

我想得到这样的东西:

enter image description here

  

有任何线索吗?

1 个答案:

答案 0 :(得分:0)

这应该有所帮助:

      <div class="form-group">
   <label class="col-md-3 control-label">Width / Height</label>
  <div class="col-md-4" style="padding-left:0">
  <input type="text" class="form-control" name="Width" value="Width" required>
  </div>

 <div class="col-md-4">
  <input type="text" class="form-control" name="Height" value="Height" required>
 </div><div class="clearfix"></div>
 <div class="col-md-3">&nbsp</div>
 <span class="help-block"><small>A block of help text that breaks onto a new line and may extend beyond one line.</small></span>
 </div>