Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of Controlling Flow inside Flex Container along Cross Axis</title> <style> .flex-container { width: 80%; min-height: 300px; margin: 0 auto; font-size: 32px; /* Safari */ display: -webkit-flex; -webkit-flex-direction: column; /* Standard syntax */ display: flex; flex-direction: column; border: 1px solid #666; } .flex-container div { padding: 10px; -webkit-flex: 1; /* Safari 6.1+ */ -ms-flex: 1; /* IE 10 */ flex: 1; /* Standard syntax */ } .item1 { background: #e84d51; } .item2 { background: #7ed636; } .item3 { background: #2f97ff; } </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> Change the value of flex-direction property from "column" to "column-reverse" to understand how this property works.</p> </body> </html>