W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <head> <style> .flex-container { display: flex; align-items: stretch; background-color: #f1f1f1; } .flex-container > div { background-color: DodgerBlue; color: white; width: 100px; margin: 10px; text-align: center; line-height: 75px; font-size: 30px; } </style> </head> <body> <h1>flex-basis 属性</h1> <p>将第三个弹性项目的初始长度设置为 200 像素:</p> <div class="flex-container"> <div>1</div> <div>2</div> <div style="flex-basis:200px">3</div> <div>4</div> </div> </body> </html>