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