css change ul order

Solutions on MaxInterview for css change ul order by the best coders in the world

showing results for - "css change ul order"
Jacobo
12 Mar 2016
1<ul>
2  <li>1</li>
3  <li>2</li>
4  <li>3</li>
5  <li>4</li>
6  <li>5</li>
7</ul>
8
9<style>
10ul {
11  display: flex;
12  flex-direction: column;
13}
14ul li:first-child {
15  order: 5;
16}
17ul li:nth-child(2) {
18  order: 4;
19}
20ul li:nth-child(3) {
21  order: 3;
22}
23ul li:nth-child(4) {
24  order: 2;
25}
26</style>