简体   繁体   中英

How to center pagination?

You can view the page I'm working on here: http://stats.escalatehosting.com/whois.php

The problem I'm having is that I just can't figure out what CSS needs to be changed to center the page numbers located at the top and bottom of the page. I've tried changing everything I can think of but it always ends up off-center when you start clicking to pages with larger numbers...

I'm not really sure what needs to be changed, if anyone has any suggestions, that would be greatly appreciated.

As you commented, center is not a valid value for float property, either you can use left , right or none which is default.

On creative2tables line 167 change your CSS as provided below..

#ct1_pager_container, #ct2_pager_container {
   margin-bottom: 15px;
   clear: right; /* Not sure if required */
   width: 300px;
}

And in the same stylesheet on line 174 change the below as

#ct1_pager, #ct2_pager {
   clear: both;
   list-style: none;
}

I've changed the above properties to center your pagination, please do check if you are using these id's for any other element as well.

You need to update below Class.

#ct1_pager_container, #ct2_pager_container{
    width:100%;
}
#ct1_pager, #ct2_pager{
    float:none;
    text-align:center;
}

Update only given element. don't update whole CSS. keep everything else as it is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM