✨ Flexbox Layout Generator

Pick the key flex properties and immediately get the matching display:flex CSS with a live preview of one, two and three items.

📐 工作原理與說明
display: flex;flex-direction / flex-wrap / justify-content / align-items / gap 組合
把 flex-direction、wrap、justify-content、align-items、gap 等屬性拼裝為 display:flex 宣告,並以 1 / 2 / 3 個專案即時演示排列效果;用於一維佈局。

Formula & Standard References

Item Formula / Note Source / Standard
Main and cross axis flex-direction sets the main axis, the cross axis stays perpendicular CSS Flexible Box Layout Level 1
Flex resolution free space follows flex-grow weights, deficits follow flex-shrink CSS Flexible Box Layout Level 1
Alignment justify-content handles the main axis, align-items the cross axis CSS Flexible Box Layout Level 1
⚠️ 使用說明與注意事項

🧩 flex 屬性速查

屬性常用取值說明
flex-directionrow / column / row-reverse / column-reverse主軸方向
justify-contentflex-start / center / flex-end / space-between / space-around / space-evenly主軸對齊
align-itemsstretch / flex-start / center / flex-end / baseline交叉軸對齊
flex-wrapnowrap / wrap / wrap-reverse是否換行
gap任意長度(如 12px)專案間距

提示:要讓單個專案在交叉軸居中可用 align-self;要控制專案伸縮用 flex: 1 或 flex-grow/shrink/basis。