CSS3 Flexbox: Flex-Direction: Column-Reverse

The flex-direction:column-reverse; displays the opposite of flex-direction:column. The following example shows the result of using the column-reverse value:

HTML file: Displayed by browser:
<style>
.flex-container {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column-reverse;
    flex-direction: column-reverse;
    width: 400px;
    height: 250px;
    background-color: lightgrey;
}
.flex-item {
    background-color: cornflowerblue;
    width: 100px;
    height: 100px;
    margin: 10px;
}
</style>
<body>
<div class="flex-container">
    <div class="flex-item">flex item 1</div>
    <div class="flex-item">flex item 2</div>
    <div class="flex-item">flex item 3</div>
</div>
<p>The flex boxes are rendered in reverse with Item 1 at the bottom</p>
</body>
flex item 1
flex item 2
flex item 3

The flex boxes are rendered in reverse with Item 1 at the bottom


Back button Table of Contents Next button