代码之家  ›  专栏  ›  技术社区  ›  bax

Rails:尝试让Bootstrap的offset类工作

  •  0
  • bax  · 技术社区  · 6 年前

    附件是我当前表单的图像,也是我希望表单的外观。补偿班似乎不适合我。

    任何帮助都将不胜感激!

    <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

    1 回复  |  直到 6 年前
        1
  •  1
  •   Anand    6 年前

    Offsetting columns

    在Bootstrap中,对于偏移量,类名称是 .col-md-offset-* 所以应该是这样

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