Wrap the flex items in reverse order with CSS

Use the flex-wrap property with wrap-reverse value to wrap flex-items in reverse order.


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

Live Demo

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