Set the flex items horizontally from right to left with CSS

Use the flex-direction property with row-reverse value to set the flex-items horizontally from right to left.


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

Live Demo

<!DOCTYPE html>
         .mycontainer {
            display: flex;
            flex-direction: row-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">
Samual Sam
Samual Sam

Learning faster. Every day.