The previously mentioned solutions for Bootstrap 3.0 did not work for me on 3.1.1. The pagination class has display:block
, and the <li>
elements have float:left
, which means merely wrapping the <ul>
in text-center
alone does not work. I have no idea how or when things changed between 3.0 and 3.1.1. Anyway, I had make the <ul>
use display:inline-block
instead. Here's the code:
<div class="text-center">
<ul class="pagination" style="display: inline-block">
<li><a href="...">...</a></li>
</ul>
</div>
Or for a cleaner setup, omit the style
attribute and put it in your stylesheet instead:
.pagination {
display: inline-block;
}
And then use the markup previously suggested:
<div class="text-center">
<ul class="pagination">
<li><a href="...">...</a></li>
</ul>
</div>
<ul class="pagination">...</ul>
inside a<div class="text-center"></div>
. – caw