正式說法:flex-direction establishes the flex container main axis;cross axis perpendicular to it。justify-content distributes free space along main axis,align-items aligns items along cross axis。
flex-direction 與主/交叉軸 Flex direction, main axis, and cross axis
白話
主軸是物件排隊的方向;交叉軸就是跟它垂直的另一條方向。
正式定義
flex-direction establishes the flex container main axis;cross axis perpendicular to it。justify-content distributes free space along main axis,align-items aligns items along cross axis。
正式說法:flex-grow is a positive free-space factor;flex-shrink is a negative free-space factor;flex-basis defines the initial main size before free space distribution。
常見混淆:flex-basis 不等於永遠的最終 width;內容、min/max size 與 free space distribution 都可能改變 used main size。
名詞與最小範例
flex-grow、shrink、basis Flex grow, shrink, and basis factors
白話
grow 決定有多的空間怎麼分,shrink 決定不夠時怎麼縮,basis 是分配前的起始尺寸。
正式定義
flex-grow is a positive free-space factor;flex-shrink is a negative free-space factor;flex-basis defines the initial main size before free space distribution。
For flex items, automatic minimum size can resolve from content-based min-content contribution;min-width:0 removes that automatic lower bound, while overflow wrapping handles unbroken inline content。
正式說法:The order property changes flex item ordinal groups in visual layout;it does not reorder DOM nodes and must not be used to repair logical reading or sequential focus order。
何時使用:只做不影響理解的小型視覺調整;若順序代表任務流程,應直接修正 HTML DOM 順序。
修改前後:Before:用 order 把 CTA 提到最前並假設所有人都先遇到它。After:DOM/Tab 維持合理流程,order 不承擔語意順序。
常見混淆:tabindex 正值也不是安全修正;它會建立另一套難維護的焦點順序。
名詞與最小範例
order 與鍵盤順序風險 Flex order and keyboard focus order
白話
order 像只把桌上的卡片挪位置,文件原本的閱讀與按 Tab 路線沒有跟著搬。
正式定義
The order property changes flex item ordinal groups in visual layout;it does not reorder DOM nodes and must not be used to repair logical reading or sequential focus order。