--- id: css-grid-item-named title: "CSS Grid Item Named" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["grid-area name", "grid-template-areas", "named grid items", "CSS Naming Grid Items", "webpage template grid", "grid area template"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.9 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "grid", "layout"] raw_sources: ["https://www.w3schools.com/css/css_grid_item_name.asp"] applied_in: [] github_commit: "" --- # [[CSS Grid Item Named]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) Naming grid items with `grid-area` and arranging those names inside `grid-template-areas` (each row in apostrophes, names separated by spaces, a period for unnamed cells) lets you describe a whole page layout as a readable visual map. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`grid-template-areas`** β€” a grid container property that specifies areas within the grid layout. [S1] - **`grid-area` naming** β€” you name grid items with the `grid-area` property, then reference the name in `grid-template-areas`. [S1] - **Apostrophe rows** β€” each area (row) is defined within apostrophes; the named grid items in each area are listed inside the apostrophes, separated by a space. [S1] - **Period for unnamed cells** β€” a period sign (`.`) refers to a grid item with no name. [S1] - **Multiple rows** β€” to define two rows (two areas), define the second row inside another set of apostrophes. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Span by repetition** β€” repeating a name across several cells in a row makes that item span those columns (e.g. five times = span five columns). [S1] - **Vertical span** β€” repeating a name across two apostrophe-rows makes the item span two rows. [S1] - **Full-page template** β€” naming every item (header, menu, main, right, footer) and laying them out in `grid-template-areas` produces a ready-to-use webpage template. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **Naming Grid Items with grid-area** The CSS `grid-template-areas` is a grid container property, and it specifies areas within the grid layout. You can name grid items by using the CSS `grid-area` property, and then reference the name in the `grid-template-areas` property. Each area is defined within apostrophes. The named grid items in each area are defined inside the apostrophes, separated by a space. [S1] Let 'Item1' get the name 'myHeader', and let it span five columns in a five-columns grid layout: [S1] ```css .container { display: grid; grid-template-areas: 'myHeader myHeader myHeader myHeader myHeader'; } .item1 { grid-area: myHeader; } ``` We can use a period sign (`.`) to refer to a grid item with no name. Let 'myHeader' span three columns in a five-columns grid layout (a period sign represents an item with no name): [S1] ```css .container { display: grid; grid-template-areas: 'myHeader myHeader myHeader . .'; } .item1 { grid-area: myHeader; } ``` To define two rows (two areas), define the second row inside another set of apostrophes. Let 'myHeader' span two columns and two rows: [S1] ```css .container { display: grid; grid-template-areas: 'myHeader myHeader . . .' 'myHeader myHeader . . .'; } .item1 { grid-area: myHeader; } ``` **Make a ready-to-use Webpage Template** Here, we name all grid items to make a ready-to-use webpage template: [S1] ```css .item1 { grid-area: header; } .item2 { grid-area: menu; } .item3 { grid-area: main; } .item4 { grid-area: right; } .item5 { grid-area: footer; } .container { display: grid; grid-template-areas: 'header header header header header header' 'menu main main main main right' 'menu footer footer footer footer footer'; } ``` The resulting layout shows the labeled areas Header, Menu, Main, Right, and Footer. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's culminating applied case is the ready-to-use webpage template that names header, menu, main, right, and footer items and maps them across a six-column, three-row `grid-template-areas`. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Name an item and reference it (language: CSS): ```css .container { display: grid; grid-template-areas: 'myHeader myHeader myHeader . .'; } .item1 { grid-area: myHeader; } ``` Full webpage template layout: ```css .item1 { grid-area: header; } .item2 { grid-area: menu; } .item3 { grid-area: main; } .item4 { grid-area: right; } .item5 { grid-area: footer; } .container { display: grid; grid-template-areas: 'header header header header header header' 'menu main main main main right' 'menu footer footer footer footer footer'; } ``` ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.9 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Grid Items]], [[CSS Grid Align]], [[CSS Grid 12-column Layout]] - **μ°Έμ‘° λ§₯락:** Declaring readable, named page regions instead of raw line numbers. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Grid Item Named β€” https://www.w3schools.com/css/css_grid_item_name.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Grid Item Named" page (Astra wiki-curation, P-Reinforce v3.1 format).