How to center jqPagination widget?


Tags: javascript,jquery,html,css

Problem :

I'm using a pagination plugin called jqPagination. The thing is that I want to center it in a parent container, but the widget uses "float:left" in the css which makes this hard.

If I remove the float:left, the widget somewhat breaks and since it doesn't use an explicit width, the old "margin-left:auto;margin-right:auto;" trick doesn't work :(

How can I center this widget in a parent container?



Solution :

Add .clearfix class (clearfix) to the jqPagination container and style

display: inline-block;
float: none;

After that wrap jqPagination container with another div and set text-align: center; for it.


    CSS Howto..

    How to give priority to a div in terms of overlapping divs on a drop down menu?

    CSS: How to use Transform property on a bootstrap grid class

    How to display form output in the same page by hiding the form

    How to position a fixed div under another fixed div?

    how to hidden image over image in css

    HTML CSS How to stop a table cell from expanding

    How to hide a segment of my website using PHP

    How can I make a fade in function without using jQuery like this? (JavaScript)

    How can I hide a button when scrolled to the top of a page?

    How to get hyperlinks inside a “pop-up” term reference on mouse-over, and seperate the HTML term from the “pop-up” reference content

    How to load CSS in specific page in php

    How to add padding to the outside of an input in css

    How to arrange two html buttons horizontally in a single line with equal width by completely fills the screen size

    How to apply CSS to my JQuery Plugin

    How to get an li to expand to fit thumbnail content?

    How do I make this list not break lines when browser size is changed?

    How to vertically center an element, that has a float, with CSS or JavaScript

    How to specify a path to be followed while animating an object in HTML using CSS, JQuery

    Greasemonkey: How to do something when style=“display: none;” changes?

    How to make margins collapse evenly?

    How to keep button active after press with jQuery

    How to Extract one images from bunch of image(Image Pack)?

    How to make specific areas in a div clickable with css / js / anything

    How to expand my CSS3 menu and reduce its width

    How to make marquee when hover in - text scroll and infinite loop, out - back to start position?

    how to get css of a clicked div using jquery?

    how can I use the CSS selector to solve this [duplicate]

    How to apply gradient to element with correctly display in IE9?

    How does a GPL license restrict commercial web applications? [closed]

    How to wrap text to the next line inside a DIV and not go off the screen