--- id: css-flexbox-container title: "CSS Flexbox Container" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["flex container", "flex-direction", "flex-wrap", "flex-flow", "justify-content align-items align-content"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.86 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "flexbox", "layout"] raw_sources: ["https://www.w3schools.com/css/css3_flexbox_container.asp"] applied_in: [] github_commit: "" --- # [[CSS Flexbox Container]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The flex container is the parent (set with `display: flex` or `inline-flex`) and exposes container-level properties β€” `flex-direction`, `flex-wrap`, `flex-flow`, `justify-content`, `align-items`, and `align-content` β€” that govern how its flex items are laid out and aligned. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **The container** β€” must be set to `flex` or `inline-flex` via the `display` property. [S1] - **flex-direction** β€” sets the display-direction of flex items. [S1] - **flex-wrap** β€” specifies whether the flex items should wrap or not. [S1] - **flex-flow** β€” a shorthand property for setting both `flex-direction` and `flex-wrap`. [S1] - **justify-content** β€” aligns the flex items when they do not use all available space on the main-axis (horizontally). [S1] - **align-items** β€” aligns the flex items when they do not use all available space on the cross-axis (vertically). [S1] - **align-content** β€” aligns the flex lines when there is extra space in the cross axis and flex items wrap. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Direction control** β€” switch the main axis with `flex-direction: row | column | row-reverse | column-reverse`. [S1] - **Wrapping control** β€” allow multi-line layouts with `flex-wrap: nowrap | wrap | wrap-reverse`. [S1] - **Shorthand** β€” combine direction and wrapping in one declaration, e.g. `flex-flow: row wrap`. [S1] - **Axis alignment** β€” `justify-content` aligns on the main (horizontal) axis; `align-items` / `align-content` align on the cross (vertical) axis. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) The flex container has seven key properties: `display` (must be set to `flex` or `inline-flex`), `flex-direction`, `flex-wrap`, `flex-flow`, `justify-content`, `align-items`, and `align-content`. [S1] **flex-direction** β€” controls the display-direction of flex items, with the values demonstrated on the page: [S1] ```css .flex-container { display: flex; flex-direction: row; } ``` ```css .flex-container { display: flex; flex-direction: column; } ``` ```css .flex-container { display: flex; flex-direction: row-reverse; } ``` ```css .flex-container { display: flex; flex-direction: column-reverse; } ``` The four values are: `row` (default β€” items left to right), `column` (items top to bottom), `row-reverse` (items right to left), and `column-reverse` (items bottom to top). [S1] **flex-wrap** β€” specifies whether items wrap when space is insufficient, with the values demonstrated on the page: [S1] ```css .flex-container { display: flex; flex-wrap: nowrap; } ``` ```css .flex-container { display: flex; flex-wrap: wrap; } ``` ```css .flex-container { display: flex; flex-wrap: wrap-reverse; } ``` The three values are: `nowrap` (default β€” items don't wrap, shown as boxes 1–9 in a single line), `wrap` (items wrap onto multiple lines as needed), and `wrap-reverse` (items wrap in reverse order). [S1] **flex-flow** β€” a shorthand property for setting both `flex-direction` and `flex-wrap`, demonstrated as: [S1] ```css .flex-container { display: flex; flex-flow: row wrap; } ``` **justify-content, align-items, align-content** β€” these properties are part of the container's property set (descriptions in the table below). On this page their specific demonstrated values were not captured in the fetched content; the source notes that horizontal alignment (`justify-content`) and vertical alignment (`align-items` & `align-content`) are covered on subpages. Specific value-by-value examples: Not found in source (for this page). [S1] **CSS Flexbox container properties reference** [S1] | Property | Description | |----------|-------------| | `display` | Must be set to `flex` or `inline-flex` | | `flex-direction` | Sets the display-direction of flex items | | `flex-wrap` | Specifies whether the flex items should wrap or not | | `flex-flow` | A shorthand property for `flex-direction` and `flex-wrap` | | `justify-content` | Aligns the flex items when they do not use all available space on the main-axis (horizontally) | | `align-items` | Aligns the flex items when they do not use all available space on the cross-axis (vertically) | | `align-content` | Aligns the flex lines when there is extra space in the cross axis and flex items wrap | ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's applied examples demonstrate each `flex-direction` value (`row`, `column`, `row-reverse`, `column-reverse`) on a `.flex-container`, each `flex-wrap` value (`nowrap`, `wrap`, `wrap-reverse`) with nine numbered boxes, and the `flex-flow: row wrap` shorthand. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Set direction and wrapping (language: CSS): ```css .flex-container { display: flex; flex-direction: row; flex-wrap: wrap; } ``` Shorthand equivalent (language: CSS): ```css .flex-container { display: flex; flex-flow: row wrap; } ``` ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.86 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Flexbox Intro]], [[CSS Flex Items]], [[CSS Grid]], [[CSS Media Queries]] - **μ°Έμ‘° λ§₯락:** Referenced when configuring the parent flex container's direction, wrapping, and alignment behavior. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Flexbox Container β€” https://www.w3schools.com/css/css3_flexbox_container.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Flexbox Container" page (Astra wiki-curation, P-Reinforce v3.1 format).