--- id: css-grid-container title: "CSS Grid Container" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["grid container", "display grid", "display inline-grid", "grid parent element", "grid container properties"] 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", "grid", "container"] raw_sources: ["https://www.w3schools.com/css/css_grid_container.asp"] applied_in: [] github_commit: "" --- # [[CSS Grid Container]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) A grid container contains one or more grid items arranged in columns and rows; an element becomes a grid container by setting `display` to `grid` or `inline-grid`, and all its direct children automatically become grid items. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Grid container definition** β€” a grid container contains one or more grid items arranged in columns and rows. [S1] - **Automatic grid items** β€” all direct child elements of a grid container automatically become grid items. [S1] - **Two display modes** β€” set `display: grid` (block-level) or `display: inline-grid` (inline) to make the container. [S1] - **Container-level properties** β€” alignment and sizing are controlled by container properties such as `justify-content`, `align-content`, `align-items`, `grid-template-columns`, `grid-template-rows`, `column-gap`, `row-gap`, `gap`, and `place-content`. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Declare the container first** β€” set `display: grid` (or `inline-grid`) before any grid-template or alignment property takes effect. [S1] - **Alignment lives on the container** β€” `justify-content` aligns items horizontally; `align-content` aligns them vertically inside the container. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) A grid container contains one or more grid items arranged in columns and rows. All direct child elements of a grid container automatically become grid items. An element becomes a grid container by setting the `display` property to `grid` or `inline-grid`. [S1] **Block-level grid** β€” use `display: grid` to make a block-level grid container. [S1] ```css .container { display: grid; } ``` **Inline grid** β€” use `display: inline-grid` to make an inline grid container. [S1] ```css .container { display: inline-grid; } ``` **Grid Container Properties** [S1] | Property | Description | |----------|-------------| | `align-content` | Vertically aligns the grid items inside the container | | `align-items` | Specifies the default alignment for items inside a flexbox or grid container | | `column-gap` | Specifies the gap between the columns | | `gap` | A shorthand property for the `row-gap` and the `column-gap` properties | | `grid-template-columns` | Specifies the size of the columns, and how many columns in a grid layout | | `grid-template-rows` | Specifies the size of the rows in a grid layout | | `justify-content` | Horizontally aligns the grid items inside the container | | `row-gap` | Specifies the gap between the grid rows | | `place-content` | A shorthand property for the `align-content` and the `justify-content` properties | The page also presents interactive "Try it Yourself" examples demonstrating `justify-content` and `align-content` with various values; the literal CSS source for those alignment-value examples is only available behind the "Try it Yourself" buttons and was: Not found in source. ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's own examples apply `display: grid` and `display: inline-grid` to a `.container`. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Declare a grid container (language: CSS): ```css .container { display: grid; /* or inline-grid */ } ``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) - **`display: grid`** β€” makes a block-level grid container. [S1] - **`display: inline-grid`** β€” makes an inline grid container. [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.86 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery). 일뢀 μ •λ ¬ κ°’ 예제 μ½”λ“œλŠ” μΆœμ²˜μ— 인라인으둜 ν‘œμ‹œλ˜μ§€ μ•ŠμŒ (Not found in source). ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Grid Intro]], [[CSS Grid Tracks]], [[CSS Grid Gaps]] - **μ°Έμ‘° λ§₯락:** Referenced whenever establishing the parent element of a grid and configuring its container-level alignment and sizing. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Grid Container β€” https://www.w3schools.com/css/css_grid_container.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Grid Container" page (Astra wiki-curation, P-Reinforce v3.1 format).