Set the flex items vertically from bottom to top with CSS

Use the flex-direction property with column-reverse value to set the flex-items vertically, from top to bottom


You can try to run the following code to implement the column-reverse value −

Live Demo

<!DOCTYPE html>
         .mycontainer {
            display: flex;
            flex-direction: column-reverse;
            background-color: orange;
         .mycontainer > div {
            background-color: white;
            text-align: center;
            line-height: 40px;
            font-size: 25px;
            width: 100px;
            margin: 5px;
      <div class = "mycontainer">

Updated on: 04-Jul-2020


Kickstart Your Career

Get certified by completing the course

Get Started