-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
center pagination? #304
Comments
Try something like this? .pagination.center,
.pagination.center ul {
float: left;
position: relative;
}
.pagination.center { left: 50%; }
.pagination.center ul { left: -50%; } and then <div class="pagination center">
…
</div> |
that worked perfectly, thanks so much! |
Instead of using relative positioning, you can also do .pagination ul {
float: none;
display: inline-block;
overflow: hidden;
}
.pagination.center {
text-align: center;
} I think this is preferable. In fact, I've put in a pull request #638 :) |
A little more cross browser friendly.
|
Thank kevva. However, don't you mean |
Nope. Have a look at the example. |
@kevva Unfortunately your demo is not how the pagination element works in bootstrap. First of all .pagination is the The .pagination ul is still floating left. Setting See http://jsfiddle.net/hMR4r/ It's needed to display This works better: http://jsfiddle.net/mJvKC/ However I think my previous version will do, since it only have to work for FF4+ / IE7+, not for older browsers. |
@jasny, yeah, you're right. You won't need overflow hidden though, but inline-block hack is needed for IE7.
|
thanks for sharing this little code |
Is there a known and preferred way to center the pagination div?
The text was updated successfully, but these errors were encountered: