Flipping a Column with Flex Items in CSS
Now let's set the flex-direction property to column-reverse. In this case, the column will flip - the elements will be pressed to the bottom. In this case, the first element will be the bottom 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: column-reverse;
width: 300px;
height: 200px;
border: 1px solid red;
}
.child {
width: 50px;
height: 50px;
border: 1px solid green;
}
: