RoR:试图缩进表单的f.text_area?

时间:2012-06-27 05:30:17

标签: ruby-on-rails ruby-on-rails-3.2

我试图缩进整个表格

<%= form_for([micropost, micropost.comments.build], :html => { :id => "blah_form" }) do |f| %>

    <div class="field">
      <p2>Who are you?</p2>
      <%= f.text_field :commenter %>
    </div>
    <div class="field">
      <p2>What deal are you offering?</p2>
      <%= f.text_area :body %>
    </div>
    <div class="actions">
      <%= f.submit "Submit"%>
    </div>
  <% end %>

我添加了#blah_form输入{margin-left:80px}来缩进整个表单。 但f.text_area没有缩进?当我将其更改为f.text_field时,它可以正常运行,但我需要它为text_area

1 个答案:

答案 0 :(得分:0)

它确实应该在css下标记,但是当它已经在这里:

你应该尝试而不是

#blah_form input {margin-left:80px}

#blah_form input, textarea {margin-left:80px}