【问题标题】:How to display all input elements inside an input-group with the same height? (Bootstrap + Demo)如何显示具有相同高度的输入组内的所有输入元素? (引导 + 演示)
【发布时间】:2018-08-17 07:00:21
【问题描述】:

我正在通过 Bootstrap 构建时间输入字段(小时和分钟)。

我用谷歌搜索了很多,并想出了一个解决方案。 但问题是,Hour 和 Minute 字段不在一行上。

两个输入如何具有相同的高度?

演示: https://www.bootply.com/BxjISccVMH

问题:

【问题讨论】:

    标签: html twitter-bootstrap user-interface twitter-bootstrap-3


    【解决方案1】:

    我通过将标签放在它自己的行中来解决这个问题,并将输入组放在下一行中。

    <div class="container">
      <div class="form-group ">
          <div class="row ">
              <label>Time</label>
          </div>
    
          <div class="row ">
            <div class="col-xs-12 input-group">
              <input type="text" class="form-control" placeholder="Std.">
              <span class="input-group-addon">:</span>
              <input type="text" class="form-control" placeholder="Min.">
            </div>
          </div>
      </div> 
    </div>
    

    Check out my codepen.

    【讨论】:

    • 感谢您花时间编写解决方案!但是我需要输入字段上方的标签(如示例中所示),以便在设计上保持一致。我想出的解决方案:codepen.io/anon/pen/wmvVYq
    • 明白了。我更新了我的答案以反映您的要求。现在检查我的代码笔,干净多了。
    猜你喜欢
    • 1970-01-01
    • 2020-04-07
    • 2017-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多