【发布时间】:2017-11-02 10:11:23
【问题描述】:
所以我进入了 Bootstrap 4 文档并尝试在我的表单行列上实现一些偏移,以便它更加居中。但是它不起作用,我不知道为什么。我四处寻找类似的问题,但在其他问题找到了解决方案的地方,我的问题没有。我在前两个输入字段中实现了 offset-5。这是页面:https://jorgeg1105.github.io/JorgePortfolioV3/,这是我遇到问题的区域的代码 sn-p:
<div class="contact text-center">
<div class="contact_container">
<div class="row">
<div class="col-xl-12">
<h2>Want To Work Together?</h2>
<p class="jorgeInfo">Tell me a little bit about yourself and your project. Then I will get in contact with you to schedule a time to chat. You can expect a reply within a day at most.</p>
</div>
</div><!--end row-->
<form>
<div class="form-row">
<div class="col-3 offset-5">
<input type="text" class="form-control" placeholder="First Name *">
</div><!--end col-->
<div class="col-3 offset-5">
<input type="text" class="form-control" placeholder="Last Name *">
</div><!--end col-->
</div><!--end row-->
<div class="form-row">
<div class="col-3">
<input type="text" class="form-control" placeholder="Phone Number">
</div><!--end col-->
<div class="col-3">
<input type="email" class="form-control" placeholder="Email *">
</div><!--end col-->
</div><!--end row-->
<div class="form-row">
<div class="col-3">
<input type="text" class="form-control" placeholder="What is 5+2? *">
</div><!--end col-->
</div><!--end row-->
<div class="row">
<div class="col-5">
<textarea class="form-control" rows="5" placeholder="Tell me a little about your project. Budget details are also appreciated."></textarea>
</div><!--end col-->
</div><!--end row-->
<button type="submit" class="button">Submit</button>
</form><!--end form-->
<p>* Required</p>
</div><!--end contact_container-->
</div><!--end contact-->
非常感谢!
【问题讨论】:
-
Bootstrap@4 是
flex-box设计。您无需使用.offset-* class。您将像这样使用justify-content-end、justify-content-between。请检查链接并阅读文档v4-alpha.getbootstrap.com/layout/grid -
@Rahul 那么如果那不是我们应该这样做的方式,为什么还要在文档中使用那个偏移量
标签: html css bootstrap-4 offset