主頁
CSS
CSS Flexbox
彈性專案
試一試:flex-grow 屬性
執行 ❯
建立您
自己的
網站
×
改變方向
儲存程式碼
改變主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> .flex-container { display: flex; align-items: stretch; background-color: #f1f1f1; } .flex-container > div { background-color: DodgerBlue; color: white; margin: 10px; text-align: center; line-height: 75px; font-size: 30px; } </style> </head> <body> <h1>The flex-grow Property</h1> <p>Make the third flex item grow eight times faster than the other flex items:</p> <div class="flex-container"> <div style="flex-grow: 1">1</div> <div style="flex-grow: 1">2</div> <div style="flex-grow: 8">3</div> </div> </body> </html>