--- id: w3css-flexbox title: "W3CSS Flexbox" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["w3-flex", "CSS Flexbox", "perfect centering", "W3.CSS 플렉스박스"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.88 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["w3css", "css-framework", "w3schools", "flexbox"] raw_sources: ["https://www.w3schools.com/w3css/w3css_flexbox.asp"] applied_in: [] github_commit: "" --- # [[W3CSS Flexbox]] ## 🎯 한 줄 통찰 (One-line insight) "Perfect centering" — a notoriously fiddly CSS problem historically — collapses to exactly TWO properties in flexbox: `justify-content:center` (horizontal) plus `align-items:center` (vertical) on the SAME container, which the source explicitly calls out as "the solution" to a common style problem, contrasting flexbox's simplicity against older centering hacks. [S1] ## 🧠 핵심 개념 (Core concepts) - **`w3-flex`** (W3.CSS 5.0+) — one-dimensional flex container (row OR column, unlike grid's row AND column). [S1] - **`flex-direction`** — `row` (default, left-to-right), `column`, `row-reverse`, `column-reverse`. [S1] - **`flex-wrap`** — `nowrap` (default), `wrap`, `wrap-reverse`. [S1] - **`justify-content`** — aligns items along the main axis: `center`, `flex-start`, `flex-end`, `space-around`, `space-between`, `space-evenly`. [S1] - **`align-items`** — aligns items along the cross axis: `center`, `flex-start`, `flex-end`, `stretch` (default), `baseline`. [S1] - **`align-content`** — aligns entire WRAPPED LINES (not individual items) when `flex-wrap:wrap` is active; distinct from `align-items`. [S1] - **Perfect centering recipe** — `justify-content:center` + `align-items:center` together on one flex container. [S1] ## 📖 세부 내용 (Details) - Basic flex container: `