Изменение порядка следования flex-элементов
- 1
- 2
- 3
- 4
- 5
Исходный код этого примера:
<style>
ul.flex {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
background: yellowgreen;
padding: 0;
margin: 0;
list-style: none;
}
li.flex {
display: inline-block;
flex: 1 1 50px;
background: tomato;
max-width: 100px;
height: 50px;
margin: 10px;
line-height: 50px;
color: white;
font-weight: bold;
font-size: 2rem;
text-align: center;
}
</style>
<ul class="flex">
<li class="flex" style="order: 2;">1</li>
<li class="flex" style="order: 2;">2</li>
<li class="flex" style="order: 4;">3</li>
<li class="flex" style="order: 2;">4</li>
<li class="flex" style="order: 0;">5</li>
</ul>
.
Прокомментировать/Отблагодарить