will_paginate分页控件不是水平对齐的

时间:2013-08-07 22:03:46

标签: html css will-paginate

我正在使用will_paginate gem提供的示例代码和CSS,以便在我的页面上提供格式良好的分页控件。但是,控件不会水平对齐。相反,它们全部垂直堆叠并居中在页面上。我怎样才能将它们放在一条水平线上?

示例代码来自:http://mislav.uniqpath.com/will_paginate/

HTML是:

<div class="apple_pagination">
  <div class="page_info">
    <%= page_entries_info @feeds %>
  </div>
  <%= will_paginate @feeds, :container => false %>
</div>

CSS是:

.apple_pagination {
  background: #f1f1f1;
  border: 1px solid #e5e5e5;
  text-align: center;
  padding: 1em;
  cursor: default;
  li {  list-style: none;  }
}

.apple_pagination a, .apple_pagination span {
  padding: 0.2em 0.3em;
}

.apple_pagination .disabled {
  color: #aaaaaa;
}

.apple_pagination .current {
  font-style: normal;
  font-weight: bold;
  background-color: #bebebe;
  display: inline-block;
  width: 1.4em;
  height: 1.4em;
  line-height: 1.5;
  -moz-border-radius: 1em;
  -webkit-border-radius: 1em;
  border-radius: 1em;
  text-shadow: rgba(255, 255, 255, 0.8) 1px 1px 1px;
}

.apple_pagination a {
  text-decoration: none;
  color: black;
}

.apple_pagination a:hover, .apple_pagination a:focus {
  text-decoration: underline;
}

1 个答案:

答案 0 :(得分:0)

尝试使用float:left;

显示按钮
.apple_pagination a{
   float:left
}
相关问题