如何在bootstrap 4中居中订阅表单?

时间:2018-04-21 14:32:42

标签: forms css-position

<footer class="container-fluid text-center">
  <p>&copy; 2018, Matir Dokan, CSEDU</p>  
  <form class="form-inline">
    <input type="email" class="form-control" size="50" placeholder="Email Address">
    <button type="button pull-right" class="btn btn-danger">Subscribe</button>
  </form>
</footer>  

enter image description here 我想在中心转移电子邮件地址和订阅选项。

2 个答案:

答案 0 :(得分:0)

欢迎使用堆栈溢出社区。您需要在align="center"<form> 试试这段代码:

   <footer class="container-fluid text-center">
   <p>&copy; 2018, Matir Dokan, CSEDU</p>  
  <form class="form-inline" align="center">
 <input type="email" class="form-control" size="50" placeholder="Email Address">
 <button type="button pull-right" class="btn btn-danger">Subscribe</button>
</form>
 </footer>

答案 1 :(得分:0)

添加一类justify-content-center

编辑:

 <form class="form-inline">

TO:

 <form class="form-inline justify-content-center">

Demo with your code