Bootstrap显示输入,lg大小更大

时间:2015-01-13 20:49:36

标签: ruby-on-rails forms twitter-bootstrap sass

当我使用Bootstrap水平样式构建表单时

<form class="form-horizontal">
  <div class="form-group form-group-lg">
    <label class="col-sm-2 control-label" for="formGroupInputLarge">Large label</label>
    <div class="col-sm-10">
      <input class="form-control" type="text" id="formGroupInputLarge" placeholder="Large input">
    </div>
  </div>
  <div class="form-group form-group-sm">
    <label class="col-sm-2 control-label" for="formGroupInputSmall">Small label</label>
    <div class="col-sm-10">
      <input class="form-control" type="text" id="formGroupInputSmall" placeholder="Small input">
    </div>
  </div>
</form>

结果不正确:

输入&#34; lg&#34;尺寸有高度:68像素

这是我的大输入:
enter image description here

这是正常的大输入:
enter image description here

我用:

  • sass 3.2.19
  • sass-rails 4.0.5
  • sprockets-rails 2.2.2
  • bootstrap-sass 3.3.1.0
  • rails 4.2.0

可能是什么问题?

1 个答案:

答案 0 :(得分:1)

您还应该为每个输入添加适当的input-xx类:

<form class="form-horizontal">
  <div class="form-group form-group-lg">
    <label class="col-sm-2 control-label" for="formGroupInputLarge">Large label</label>
    <div class="col-sm-10">
      <input class="form-control input-lg" type="text" id="formGroupInputLarge" placeholder="Large input">
    </div>
  </div>
  <div class="form-group form-group-sm">
    <label class="col-sm-2 control-label" for="formGroupInputSmall">Small label</label>
    <div class="col-sm-10">
      <input class="form-control input-sm" type="text" id="formGroupInputSmall" placeholder="Small input">
    </div>
  </div>
</form>