Placing Flex Items in an Inverted Row in CSS
The row-reverse value in the flex-direction property allows you to line up blocks by pushing them to the right edge. This will flip the order - the first block will be the rightmost one:
<div class="parent">
<div class="child">1</div>
<div class="child">2</div>
<div class="child">3</div>
</div>
.parent {
display: flex;
flex-direction: row-reverse;
width: 300px;
height: 200px;
border: 1px solid red;
}
.child {
width: 50px;
height: 50px;
border: 1px solid green;
}
: