这是我认为的相关代码:
<%= form_for CustomerEmail.new, :html => {:class => "js-ajax-submit js-customer-email-form invisible", :rel => {:reload => true}.to_json} do |c| -%>
<%= c.label :email, 'Email' %>
<%= c.text_field :email %>
<%= c.submit "Submit", :class => "small-button" %>
<a href="#" class='js-close-popup'>Cancel</a>
<% end -%>
目前,“取消”链接位于标有“电子邮件”的文本框右侧。我需要将它移到提交按钮的右侧。
我已经尝试了所有我知道的 html 标签:div、span、td、tr、li。这些都没有让我到达我需要到达的地方。
我还尝试了一些 css:style='float: right;填充顶部:5px;向右填充:20px;填充底部:5px'
运气不好....
最佳答案
<%= form_for CustomerEmail.new, :html => {:class => "js-ajax-submit js-customer-email-form invisible", :rel => {:reload => true}.to_json} do |c| -%>
<%= c.label :email, 'Email' %>
<%= c.text_field :email %>
<div style="float: right">
<%= c.submit "Submit", :class => "small-button", :style => "float: left;" %>
<div style="display: block; float: left; padding: 5px 0px 5px 20px;">
<a href="#" class='js-close-popup'>Cancel</a>
</div>
</div>
<% end -%>
关于html - 如何将我的链接移动到提交按钮的右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8658593/