0
I have the following structure:
.pai{
width: 300px;
display: flex;
flex-wrap: wrap;
}
.filho{
width: 80%;
margin-top: -1px;
border: 1px solid black;
}
.ordem1{order:1}
.ordem2{order:2}
.ordem3{order:3}
.ordem4{order:4}
.ordem5{order:5}
.filho:nth-child(odd) {background: #e0e0e0;}
<div class="pai">
<div class="filho ordem5">Zebra5 (cinza)</div>
<div class="filho ordem3">Zebra3 (cinza)</div>
<div class="filho ordem4">Zebra4 (branca)</div>
<div class="filho ordem2">Zebra2 (branca)</div>
<div class="filho ordem1">Zebra1 (cinza)</div>
</div>
But I would like the Ivs to be zebrad according to the property order
css in the same sequence.
Any suggestions ?
Do you want them to be alternating between gray and white? In case, wouldn’t it be better to put the color within the order class? Or already receive ordered?
– Felipe Avelar
Yes, zebras between gray and white obeying the css order property.
– Pedro Augusto
I already get paid
– Pedro Augusto
With Javascript you can sort the Divs by class
ordem
without having to use theorder
flex. See an example: https://jsfiddle.net/g95f712u/– Sam