--- id: css-flexbox-align-items title: "CSS Flexbox Align Items" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["align-items", "align-content", "flexbox cross-axis alignment", "vertical flex alignment", "flexbox centering"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.89 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "flexbox", "align-items", "align-content"] raw_sources: ["https://www.w3schools.com/css/css3_flexbox_container_align.asp"] applied_in: [] github_commit: "" --- # [[CSS Flexbox Align Items]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) `align-items` manages vertical alignment of flex items along the cross-axis, while `align-content` aligns wrapped flex lines; combining `justify-content: center` with `align-items: center` produces true centering. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`align-items` = cross-axis alignment** β€” controls vertical alignment of flex items along the cross-axis. [S1] - **`align-content` = line alignment** β€” aligns the flex lines, and only has effect when flex items wrap onto multiple lines. [S1] - **True centering** β€” set both `justify-content` and `align-items` to `center`. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Height is required to see effect** β€” the cross-axis examples set a `height` on the container so vertical alignment is observable. [S1] - **`align-content` needs `flex-wrap: wrap`** β€” line alignment only matters once items wrap onto multiple lines. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **The align-items Property** The `align-items` property manages vertical alignment of flex items along the cross-axis. Available values are `normal` (default), `stretch`, `center`, `flex-start`, `flex-end`, and `baseline`. [S1] The `center` value aligns the flex items in the middle of the container. [S1] ```css .flex-container { display: flex; height: 200px; align-items: center; } ``` The `flex-start` value aligns the flex items at the top of the container. [S1] ```css .flex-container { display: flex; height: 200px; align-items: flex-start; } ``` The `flex-end` value aligns the flex items at the bottom of the container. [S1] ```css .flex-container { display: flex; height: 200px; align-items: flex-end; } ``` The `stretch` value stretches the flex items to fill the container (this is equal to `normal`, which is default). [S1] ```css .flex-container { display: flex; height: 200px; align-items: stretch; } ``` **The align-content Property** The `align-content` property aligns the flex lines. It only has effect when flex items wrap onto multiple lines. Available values are `stretch` (default), `center`, `flex-start`, `flex-end`, `space-between`, `space-around`, and `space-evenly`. [S1] With `center`, the flex lines are packed toward the center of the container. [S1] ```css .flex-container { display: flex; height: 400px; flex-wrap: wrap; align-content: center; } ``` With `space-between`, the space between the flex lines are equal. [S1] ```css .flex-container { display: flex; height: 400px; flex-wrap: wrap; align-content: space-between; } ``` **True Centering with Flexbox** To achieve true centering, set both the `justify-content` and the `align-items` properties to `center`. [S1] ```css .flex-container { display: flex; height: 400px; justify-content: center; align-items: center; } ``` ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's own examples apply each value to a `.flex-container` with a fixed `height`, plus a combined centering example. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Center flex items on both axes (language: CSS): ```css .flex-container { display: flex; height: 400px; justify-content: center; align-items: center; } ``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) - **`align-items`** β€” aligns individual flex items along the cross-axis; works on single-line layouts. [S1] - **`align-content`** β€” aligns whole flex lines and only has effect when items wrap onto multiple lines (requires `flex-wrap: wrap`). [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.89 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Flexbox Justify Content]], [[CSS Flex Items]], [[CSS Flexbox Responsive]] - **μ°Έμ‘° λ§₯락:** Referenced whenever aligning flex items vertically (cross-axis) or centering content within a flex container. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Flexbox Align Items β€” https://www.w3schools.com/css/css3_flexbox_container_align.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Flexbox Align Items" page (Astra wiki-curation, P-Reinforce v3.1 format).