【问题标题】:How to put multiple input fields in one row using bootstrap?如何使用引导程序将多个输入字段放在一行中?
【发布时间】:2017-05-24 18:06:59
【问题描述】:

是否有任何 bootstrap3 方法可以将所有这些文件放在一行中?如果可能的话,我也想保留input-group 解决方案。

<div class="input-group">
    <input type="text" name="name" placeholder="Name" class="form-control" required>
    <input type="text" name="tel" placeholder="Phone" class="form-control">
    <input type="text" name="email" placeholder="E-mail" class="form-control">
    <button type="submit" class="btn btn-primary">
        <i class="fa fa-btn fa-plus"></i>
    </button>
</div>

如果没有CSS 风格的黑客攻击,这可能吗?

【问题讨论】:

标签: css twitter-bootstrap twitter-bootstrap-3


【解决方案1】:

你可以这样做

<div class="form-inline">
    <input type="text" name="name" placeholder="Name" class="form-control" required>
    <input type="text" name="tel" placeholder="Phone" class="form-control">
    <input type="text" name="email" placeholder="E-mail" class="form-control">
    <button type="submit" class="btn btn-primary">
        <i class="fa fa-btn fa-plus"></i>
    </button>
</div>

【讨论】:

  • 在这种情况下.input-group 似乎没有用(如果您出于其他原因不使用它),这就是为什么我只提供给您.form-inline
猜你喜欢
  • 2020-01-22
  • 2017-01-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-02-04
  • 1970-01-01
  • 2017-02-21
相关资源
最近更新 更多