我試圖縮進這整個形式:CSS:我如何縮進一個文本區域而不是另一個文本區域?
<%= 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 %>
,但我不想以這種形式縮進這個其他文本區域:
<%= form_for(@micropost) do |f| %>
<%= render 'shared/error_messages', object: f.object %>
<div class="field">
<%= f.text_area :content, placeholder: "What's something else you want to buy?" %>
</div>
<%= f.submit "Post", class: "btn btn-large btn-primary" %>
<% end %>
現在我的CSS文件說:
#blah_form input, textarea, b4 {margin-left:80px}
perfect thanksdd – BigBoy1337 2012-07-24 21:39:41