【问题标题】:How can i vertical align center forms我如何垂直对齐中心表格
【发布时间】:2020-03-31 20:01:03
【问题描述】:

在我问之前,我必须先说我尝试了垂直方法对齐,它没有工作,所以我必须发布我的这个问题。抱歉,这可能是一个微不足道的问题,但我正在努力解决它。

<div class="container-fluid">
  <div class="row">
    <div class="col-sm-3">
      One of three columns
    </div>
    <div class="col-sm-6">
        <section>
        <h1>Signup</h1>
            <form action="includes/signup.inc.php" method="post">
                <input type="text" name="uid" placeholder="Username">
                <input type="text" name="mail" placeholder="E-mail">
                <input type="password" name="pwd" placeholder="Password">
                <input type="password" name="pwd-repeat" placeholder="Repeat password">
                <button class="btn btn-default" type="submit" name="signup-submit">Signup</button>
            </form>
        </section>
    </div>
    <div class="col-sm-3">
      One of three columns
    </div>
  </div>
</div>

【问题讨论】:

  • 请描述您尝试过的其他方法。这将帮助其他人缩小他们的建议范围。我还建议填写您的帖子标题,使其看起来像一个完整的问题:“我怎样才能_____?”这将帮助人们了解您希望共享代码的结果。
  • Oke thx on tip,我是新来的。

标签: forms bootstrap-4 vertical-alignment


【解决方案1】:

为每个输入元素添加form-control 类。

<input class="form-control" type="text" name="uid" placeholder="Username">
<input class="form-control" type="text" name="mail" placeholder="E-mail">
<input class="form-control" type="password" name="pwd" placeholder="Password">
<input class="form-control" type="password" name="pwd-repeat" placeholder="Repeat password">

【讨论】:

  • 谢谢哥们,快速准确的回答:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-02-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-03-25
相关资源
最近更新 更多