Using CSS :even and :odd pseudo-classes with list items add classes via Jquery jQuery("li:odd").addClass("odd"); jQuery("li:even").addClass("even"); and use css: .odd {float:left !important;} .even {float:right !important;}
li {
color: blue;
}
li:nth-child(odd) {
color: green;
}
li:nth-child(even) {
color: red;
}