W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <head> <style> #main { width: 400px; height: 100px; border: 1px solid #c3c3c3; display: flex; justify-content: flex-end; } #main div { width: 70px; height: 70px; } </style> </head> <body> <h1>justify-content 属性</h1> <p>The "justify-content: flex-end;" 在容器末尾对齐弹性项目:</p> <div id="main"> <div style="background-color:coral;">1</div> <div style="background-color:lightblue;">2</div> <div style="background-color:pink;">3</div> </div> <p><b>注释:</b>Internet Explorer 10 以及更早的版本不支持 justify-content 属性。</p> </body> </html>