Trying to implement Bootstrap 3.1.1 pagination, I discovered that the solutions meant for 3.0 didn't work for me. The issue lies in the pagination class having display:block
, while the <li>
elements have float:left
. Simply adding text-center
to the <ul>
did not achieve the desired result. It's unclear when or how these changes occurred between versions 3.0 and 3.1.1. To resolve this, I had to change the <ul>
to use display:inline-block
. Here is the updated code snippet:
<div class="text-center">
<ul class="pagination" style="display: inline-block">
<li><a href="...">...</a></li>
</ul>
</div>
For a more organized approach, you can remove the style
attribute and add it to your stylesheet instead:
.pagination {
display: inline-block;
}
After making these adjustments, you can stick to the previously suggested markup:
<div class="text-center">
<ul class="pagination">
<li><a href="...">...</a></li>
</ul>
</div>