Grow your CSS skills. Land your dream job.

Help: Centering WordPress Pagination

  • Anonymous
    # December 31, 2010 at 6:15 pm

    I am working on moving my website onto wordpress. I’d like to have the pagination centred rather than aligned to the left.
    How do I do this?

    See my code here:

    http://www.aarongmoore.com/test/

    # December 31, 2010 at 11:33 pm

    well, do you know any css? You can use css to center the text. It depends on how you wrote your blog or how you set it up. You can view the source code of the page and see what class has been given to the pagination and then in your stylesheet you add that class and center the text

    Anonymous
    # January 1, 2011 at 3:57 am

    I used the pagination from: http://design.sparklette.net/teaches/how-to-add-wordpress-pagination-without-a-plugin/

    I tried adding “text-align: center” but that seemed to have no effect.

    # January 1, 2011 at 5:42 am

    CSS:

    div.pagination{display: table; margin: 0 auto;}

    No effect on IE 6 or 7 though – You could see it as progressive enhancement.

    # January 1, 2011 at 7:37 am

    I think you should wrap pagination with div and adjust css for that div.

    # January 1, 2011 at 9:15 am

    @koko the pagination is dynamic in size and a set width will have to be given to the div wrapper.

    # June 6, 2013 at 6:46 am

    @jamy_za Thank you!! Seems like such a simple thing to do but the dynamic width poses a problem, display:table works great, neat little trick.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".