0

我正在尝试缩进整个表格

<%= 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

4

1 回答 1

0

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

你应该尝试而不是

#blah_form input {margin-left:80px}

这个

#blah_form input, textarea {margin-left:80px}
于 2012-06-27T07:08:00.273 回答