W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <head> <style> .flex-container { display: flex; flex-direction: row-reverse; background-color: DodgerBlue; } .flex-container > div { background-color: #f1f1f1; width: 100px; margin: 10px; text-align: center; line-height: 75px; font-size: 30px; } </style> </head> <body> <h1>flex-direction 属性</h1> <p>"flex-direction: row-reverse;" 水平地并排弹性项目(但是从右向左):</p> <div class="flex-container"> <div>1</div> <div>2</div> <div>3</div> </div> </body> </html>