我如何垂直对齐中心表格

问题描述 投票:0回答:1

[我问我首先要说我尝试垂直方法对齐之前,它没有用,所以我必须发布我的这个问题。很抱歉,这可能是一个琐碎的问题,但我正在努力解决。

<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>
forms bootstrap-4 vertical-alignment
1个回答
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">

enter image description here

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.