首页
CSS
CSS Flexbox
Flex 容器
Tryit:使用 flex-direction: row-reverse
运行 ❯
获取您的
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!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>The flex-direction Property</h1> <p>The "flex-direction: row-reverse;" stacks the flex items horizontally (but from right to left):</p> <div class="flex-container"> <div>1</div> <div>2</div> <div>3</div> </div> </body> </html>