gpt4 book ai didi

css - rails : Trying to get Bootstrap's offset class to work

转载 作者:太空宇宙 更新时间:2023-11-04 06:55:03 25 4
gpt4 key购买 nike

我正在尝试使用 Bootstrap 的偏移类使这些表单字段居中。

附件是我当前表单的图像,以及我希望表单的外观。偏移量类似乎对我不起作用。

任何帮助将不胜感激!

以下所有代码都在 div.container 中:

<div class="row">
<div class="col-md-6 offset-md-6">
<%= f.label :title %><br />
<%= f.text_field :title, class: 'form-control'%><br /><br />
<%= f.label :description %><br />
<%= f.text_area :description, class: 'form-control' %><br /><br />
<%= f.label :image %><br />
<%= f.file_field :image, class: 'form-control-file' %><br />
</div>
</div>

enter image description here

enter image description here

最佳答案

Offsetting columns

在 Bootstrap 中,偏移类名是 .col-md-offset-*所以应该是

<div class="col-md-4 col-md-offset-4">
#...
</div>

关于css - rails : Trying to get Bootstrap's offset class to work,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52528924/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com