I have the follow HTML:
<div id="menu">
<ul class="menu">
<li class="item-101"><a href="/">Home</a></li>
<li class="item-113"><a href="/sobre">Sobre</a></li>
<li class="item-114"><a href="/portfolio">Portfolio</a></li>
<li class="item-115"><a href="/bastidores">Bastidores</a></li>
<li class="item-116"><a href="/blog">Blog</a></li>
<li class="item-117"><a href="/contato">Contato</a></li>
</ul>
</div>
and CSS:
#menu{width:900px;margin:0 auto;}
#menu ul{margin:0;padding:0;}
#menu li{float:left;margin:10px;}
#menu .item-115, #menu .item-116, #menu .item-117{float:right;}
I want 3 menus floating left and 3 floating right, but they are reverting order.
How to do this?
Here’s what I suggest: http://jsfiddle.net/thirtydot/w64Nb/2/
The HTML is identical to what’s in your question.
Instead of relying on certain classes being present, or forcing them to be the same using JavaScript, you can just solve the whole problem with jQuery (which in a different comment, you said you have available):
That will take the last three
liinside#menu, add the.rightclass (which is justfloat: right), and reverse the order in the HTML.