I have a pagination output which is show within
The ul is wrapped around 2 divs
1st div is 550 width 2nd div called "paginationDiv" basically wraps the ul around
The ul has list-style: none. What I am trying to do is make it float right, but it keeps appearing as a block. I have tried quite a few things but nothing seems to work. If I add a width to the paginationDiv then it works but it's not accurate because it will never be fixed width
Here is what it looks like:
<div class="parentDiv">
<div class="paginationDiv">
<ul id="paginationLinks">
<li>Page 1</li>
<li>Page 2</li>
</ul>
</div>
</div>
That's the html code
Here is the css:
div.parentDiv {
width: 550px;
}
div.paginationDiv {
float: right;
}
#paginationLinks ul {
border: 0;
padding: 0;
margin: 0;
}
#paginationLinks li {
list-style: none;
}
I have posted an example here: http://jsfiddle.net/6N4bD/1/
To make a right-aligned version of the list, only three changes need to occur. First, set the "UL" "text-align" to "right". Second, change the left "background-position" from "0" to "100%" - which makes the image align up with the right edge. And finally change "padding-left" to "padding-right".
You can do this by setting the display property to "flex." Then define the align-items and justify-content property to “center.” This will tell the browser to center the flex item (the div within the div) vertically and horizontally.
give float:left
to #paginationLinks li
and then see the result
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With