我尝试在设计class="col-md-6 col-md-offset-3"
周围放置一个simple_form
的div块,期望这将占用我的屏幕宽度的1/3,并将其集中(偏移)。它没有用。为什么呢
<div class="col-md-6 col-md-offset-3">
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :email,
required: true,
autofocus: true ,
input_html: { autocomplete: "email" }%>
<%= f.input :password,
required: true,
hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length),
input_html: { autocomplete: "new-password" } %>
<%= f.input :password_confirmation,
required: true,
input_html: { autocomplete: "new-password" } %>
</div>
<div class="form-actions">
<%= f.button :submit, "Sign up" %>
</div>
<% end %>
</div>
答案 0 :(得分:0)
该类是offset-md-3
而不是col-md-offset-3
<div class="row">
<div class="col-md-6 offset-md-3">
...
</div>
</div>