我在我的应用程序上使用引导程序,并且很难使用引导程序垂直对齐某些项目。它由一个引导行和 3 个带有搜索栏、标题和导航链接的 span4 组成。
这是骨架:
<div class="row">
<div class="span4">
form code, as generated by rails form_for
<div class="span4">
Page title
<div class="span4">
pagination links, as generated by rails will_paginate
这是导轨代码:
<div class="row">
<div class="span4">
<%= form_tag mybooks_path, class: "form-search", :method => 'get', :id => "mybooks_search" do %>
<div class="input-append">
<%= text_field_tag :search, params[:search], class: "search-query" %>
<%= submit_tag "Search", :name => nil, class: "btn" %>
</div>
<% end %>
</div>
<div class="span4">
<h2>My book library</h2>
</div>
<div class="span4">
<%= will_paginate @mybooks, class: "pagination pagination-right" %>
</div>
</div>
这是 JSFiddle:
我正在使用标准的未自定义引导程序 2,并且我需要搜索框、页面标题和分页链接彼此垂直对齐。