0

当我在rails中隐藏一个按钮时,其他按钮移动到那个地方我想将按钮放在平行线上,如果其他按钮的位置在那种情况下不可见,则应该清楚......我的代码如下:

<div class=" list_el">
              <span class="pull-right" style="text-align:right">
              <%if accountant?%>
                <%= link_to_if(!crm_donation["received"],  "Approved", crm_donations_path(:id => crm_donation["id"]), :class => "label label-success") if !crm_donation["received"]%>
              <%end%>

              <%= link_to "rollback", edit_crm_donation_rollback_path(crm_donation["id"]), :class => 'label label-info'  if supervisor? && crm_donation["rollback_id"].blank?%>

              <%= link_to "delete",  crm_donation_path(crm_donation["id"]), :class => 'label label-important1', method: :delete, data: { confirm: 'Are you sure?' } if accountant? && !crm_donation["received"]%>

              <%= link_to "details", crm_donation_path(crm_donation["id"]), :class => 'label label-success' %>


              <%if !accountant?%>
                <%= link_to "pdf", "/letter/#{crm_donation["id"]}.pdf", :class => "label label-info1", :target=>"_blank"%>

                <%if crm_donation["email_sent"]%>
                  <%=link_to_if(crm_donation["received"], "email", donation_email_sent_path(crm_donation["email_sent"]), :class=>"label label-emails") { label_tag( "email" , "email",:class => "label") }%>

                <%else%>
                  <%if !crm_donation["rollback_id"]%> 
                    <%=link_to_if(crm_donation["received"], "email", new_donation_email_sent_path(:donation_id => crm_donation["id"]), :class=>"label label-emailf") { label_tag( "email" , "email",:class => "label") } %>
                  <%end%>  

                <%end%>
              <%end%>

            </span>
            </div>

按钮位置是这样的:

                 details | pdf
rollback | details | pdf | email

我想这样做:

           details | pdf
rollback | details | pdf | email
4

1 回答 1

0

首先删除内联样式并将所有样式放在资产管道中。为每个按钮创建 div,然后使用 css 定位正确对齐它们。如果您隐藏了一些按钮并且它正在改变按钮的对齐方式(正如您在问题中提到的那样),那么使用可见性:隐藏而不是显示:无。当你做可见性:隐藏到特定元素时,该元素仍然存在但它被隐藏了

于 2013-09-16T10:37:50.583 回答