Twitter bootstrap 具有自定义字体大小和输入组的引导

Twitter bootstrap 具有自定义字体大小和输入组的引导,twitter-bootstrap,Twitter Bootstrap,正如您所看到的,我正在使用一个定制的引导程序,字体大小为13px,行高为1.538461538(20/13) 然而,当我将输入组与输入组btn一起使用时,元素并没有像您可以查找的那样对齐 我应该如何配置引导以使用13px字体大小并保持组件对齐?带输入组的组件的基本代码为: <div class="container-fluid"> <div class="row"> <div class="col-xs-4 form-group"> &

正如您所看到的,我正在使用一个定制的引导程序,字体大小为13px,行高为1.538461538(20/13)

然而,当我将输入组与输入组btn一起使用时,元素并没有像您可以查找的那样对齐

我应该如何配置引导以使用13px字体大小并保持组件对齐?带输入组的组件的基本代码为:

<div class="container-fluid">
  <div class="row">
    <div class="col-xs-4 form-group">
      <label>Foo</label>
      <div class="input-group">
        <input type="text" class="form-control" value="" />
        <div class="input-group-btn">
          <button type="button" class="btn btn-default">Go!</button>
        </div>
      </div>
    </div>
  </div>
</div>

福
走!
此css部分使用“高度:100%”

.input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child>.btn, .input-group-btn:first-child>.btn-group>.btn, .input-group-btn:first-child>.dropdown-toggle, .input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle), .input-group-btn:last-child>.btn-group:not(:last-child)>.btn
包装类“输入组”的高度为34像素。因此,您的所有输入都需要具有该大小才能完全对齐。

在css部分使用“高度:100%”

.input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child>.btn, .input-group-btn:first-child>.btn-group>.btn, .input-group-btn:first-child>.dropdown-toggle, .input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle), .input-group-btn:last-child>.btn-group:not(:last-child)>.btn

包装类“输入组”的高度为34像素。因此,您的所有输入都需要具有该大小才能完全对齐。

解决方案是将行高因子调整为大于目标大小(20px)的值,然后乘以字体大小(13px)。在我的例子中,1.538461538应该是1.538461539。

解决方案是在乘以字体大小(13px)时,将行高因子调整为大于目标大小(20px)的值。在我的例子中,1.538461538应该是1.538461539