HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> h2+div{ display: flex; width: 100%; height: 250px; border: 1px solid #8c8c8c; } h2+div > div{ width: 50px; height: 50px; border: 1px solid #8c8c8c; margin: 10px; } #parent{ flex-direction: row; } #parent1{ flex-direction: row-reverse; } #parent2{ flex-direction: column; } #parent3{ flex-direction: column-reverse; } </style> </head> <body> <h1>CSS flex-direction Property</h1> <h2>flex-direction: row; (default)</h2> <div id="parent"> <div>Div 1</div> <div>Div 2</div> <div>Div 3</div> </div> <h2>flex-direction: row-reverse;</h2> <div id="parent1"> <div>Div 1</div> <div>Div 2</div> <div>Div 3</div> </div> <h2>flex-direction: column;</h2> <div id="parent2"> <div>Div 1</div> <div>Div 2</div> <div>Div 3</div> </div> <h2>flex-direction: column-reverse;</h2> <div id="parent3"> <div>Div 1</div> <div>Div 2</div> <div>Div 3</div> </div> </body> </html>
OUTPUT
×

Save as Private