given a HTML of:
<div class="class">1</div>
<div class="class">2</div>
<div class="class">3</div>
<div class="class">4</div>
I know I can do a display:flex
together with:
.class :nth-child(1) { order: 2 }
.class :nth-child(2) { order: 4 }
.class :nth-child(3) { order: 1 }
.class :nth-child(4) { order: 3 }
which should produce
<div class="class">3</div>
<div class="class">1</div>
<div class="class">4</div>
<div class="class">2</div>
Is there a way to do this without using the flexbox in combination with its order property?
flexbox
?