<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Controlling Flow inside Flex Container along Main Axis</title> <style> .flex-container { width: 80%; min-height: 300px; margin: 0 auto; font-size: 35px; /* Safari */ display: -webkit-flex; -webkit-flex-direction: row-reverse; /* Standard syntax */ display: flex; flex-direction: row-reverse; border: 5px solid purple; } .flex-container div { padding: 10px; -webkit-flex: 1; /* Safari 6.1+ */ -ms-flex: 1; /* IE 10 */ flex: 1; /* Standard syntax */ } .item1 { background: red; } .item2 { background: Lightgreen; } .item3 { background: blue; } </style> </head> <body> <div class="flex-container"> <div class="item1">Item 1</div> <div class="item2">Item 2</div> <div class="item3">Item 3</div> </div> <p><strong>Note:</strong> The Change value of flex-direction property from "row-reverse" to "row" to understand how this property works.</p> </body> </html>