I am trying to make a custom sidebar in wordpress, i have all the element and info in li’s, what i am trying to do is try to shift the half of the total li’s to left and half to the right…
What i am using is float/clear left and right, that not seems to work as i wanted…
HTML Structure:-
<ul>
<li class="left">Left</li>
<li class="left">Left</li>
<li class="left">Left</li>
<li class="left">Left</li>
<li class="left">Left</li>
<li class="right">Right</li>
<li class="right">Right</li>
<li class="right">Right</li>
<li class="right">Right</li>
<li class="right">Right</li>
</ul>
The CSS:-
.left { float:left; width:50%; clear:left; }
.right { float:right; width:50%; clear:right }
If you’re willing to give up your list style disc (depending on the browser), you can do this easily without floats or modifying your markup.
http://jsfiddle.net/Duejc/2/
Why don’t you brake it down like this, depending on the case 🙂
or do it as @Xander says 🙂
Shuffle you’re HTML. when an element is
clear
ed it does so against the previously floated element; in your case, it was the sixth element clearing the fifth:jsFiddle
Done it with simple markup and styles
http://codepen.io/ruinunes/pen/bpgpZV
HAML:
SCSS