Demo flex-item order
by Nguyen Tuan
HTML
<ul class="flex-container row">
<li class="flex-item one">1</li>
<li class="flex-item two ">2</li>
<li class="flex-item three">3</li>
<li class="flex-item four">4</li>
<li class="flex-item five">5</li>
</ul>
CSS
.flex-container {
padding: 0;
margin: 0;
list-style: none;
-ms-box-orient: horizontal;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -moz-flex;
display: -webkit-flex;
}
.row {
-webkit-flex-direction: row;
flex-direction: row;
flex-wrap: normal;
}
.flex-item {
background: tomato;
padding: 5px;
width: 50px;
height: 50px;
margin: 5px;
line-height: 50px;
color: white;
font-weight: bold;
font-size: 2em;
text-align: center;
}
.three {
order: -1;
background: gold
}
.five {
order: -2;
background: #594255;
}