5

Given the following list (different height):

<ul>
    <li>11111111</li>
    <li>2222<br>2222</li>
    <li>33333333</li>
    <li>44444444</li>
    <li>55555555</li>
    <li>66666666</li>
</ul>

list animation

is it possible to animate the order of the list (Figure 1), for example moving the element <li>2222<br>2222</li> to the bottom of the list using CSS only?

Shlomi Schwartz
  • 8,693
  • 29
  • 109
  • 186
  • Maybe [this](http://stackoverflow.com/questions/14011125/changing-dom-element-order-with-css-crocodoc#answer-25462829) will help you? – Huelfe Oct 05 '16 at 11:34
  • are there variables within the list. ie. length of text, width of list items, number of items in list, a class toggled on and off to trigger the position change? – haxxxton Oct 05 '16 at 11:35
  • To swap elements in order the commen von @Huelfe works just fine, but if you want to have an animation you can't do that css only. Therefore you would use Javscript to calculate where to put the `
  • ` based on it's height and move every other element relative to that one moving.
  • – Aaron Mahlke Oct 05 '16 at 11:37
  • 2
    Why include a jQuery tag if this is for CSS only? – Curtis Oct 05 '16 at 11:47
  • Thanks for your replies, prefer a CSS solution but JQ will do fine as an alternative – Shlomi Schwartz Oct 05 '16 at 12:02