【问题标题】:Rails Bootstrap Form: Fill the whole horizontal row?Rails Bootstrap Form:填充整个水平行?
【发布时间】:2015-02-06 16:17:21
【问题描述】:

这段代码

<div class="row">
        <div class="col-md-8 col-md-offset-2">
        <%= bootstrap_form_for @keen, remote: true, html: {class: 'emailForm form-inline'} do |f| %>
            <%= f.email_field :email, hide_label: true %>
            <%= f.submit "OK, LET'S GO!" %>
        <% end %>
    </div>
</div>

input fieldsubmit button 放在同一水平行(这很好),但input fieldsubmit button 都“强制”在行的左侧。我怎样才能使输入字段和提交按钮填满整行(输入字段占用大部分空间)?

【问题讨论】:

    标签: ruby-on-rails forms twitter-bootstrap


    【解决方案1】:

    我可能会误会,但我相信您需要做的就是:

    改变

    <div class="col-md-8 col-md-offset-2">
    

    <div class="col-md-12">
    

    col-md-8 告诉元素占用 12 个可用列中的 8 个,col-md-offset-2 告诉该列向右移动(偏移)2 列。

    【讨论】:

    • 对不起,这只会使行从左到右填满整个容器,但输入字段和提交按钮仍然会被强制到行的左侧,而不是 100% 填满行。 .
    猜你喜欢
    • 2013-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多