--- id: css-rwd-grid-view title: "CSS RWD Grid View" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["grid view", "responsive grid", "grid-template-areas", "RWD grid", "box-sizing border-box"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.88 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "responsive", "grid"] raw_sources: ["https://www.w3schools.com/css/css_rwd_grid.asp"] applied_in: [] github_commit: "" --- # [[CSS RWD Grid View]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) A grid-view divides the page into rows and columns; using `box-sizing: border-box` and a `display: grid` container with named `grid-template-areas`, you build a layout whose regions can later be rearranged with media queries for different screen sizes. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Grid-view** β€” many web pages are based on a grid-view, which means that the page is divided into rows and columns. [S1] - **`box-sizing: border-box`** β€” applied to all elements, this makes sure that the padding and border are included in the total width and height of the elements. [S1] - **CSS Grid container** β€” `display: grid` on a container, combined with `grid-template-areas`, defines named layout regions (header, menu, main, facts, footer). [S1] - **`gap`** β€” the container sets spacing between grid items (here `gap: 10px`). [S1] - **Next step** β€” the page points to adding media queries and breakpoints for different screen sizes in the next chapter. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Named-area layout** β€” assign each block a `grid-area` name and lay them out by listing those names in `grid-template-areas`, making the structure readable and easy to rearrange. [S1] - **Universal border-box reset** β€” `* { box-sizing: border-box; }` removes width-math surprises across the whole document. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **What is a Grid-View?** Many web pages are based on a grid-view, which means that the page is divided into rows and columns. [S1] **box-sizing** The `box-sizing` property allows us to include the padding and border in an element's total width and height. Applying it to all elements makes sure that the padding and border are included in the total width and height of the elements. [S1] **Complete CSS** [S1] ```css * { box-sizing: border-box; } body { font-family: "Lucida Sans", sans-serif; font-size: 17px; } .grid-container { display: grid; grid-template-areas: 'header' 'menu' 'main' 'facts' 'footer'; background-color: white; gap: 10px; } .header { grid-area: header; background-color: purple; text-align: center; color: #ffffff; } .header > h1 { font-size: 40px; } .menu { grid-area: menu; } .menu ul { list-style-type: none; margin: 0; padding: 0; } .menu li { padding: 8px; margin-bottom: 7px; background-color: #33b5e5; color: #ffffff; } .menu li:hover { background-color: #0099cc; } .content { grid-area: main; } .content > h1 { font-size: 30px; margin-bottom: 7px; } .content > p { margin-bottom: 7px; } .facts { grid-area: facts; border: 1px solid #0099cc; background-color: beige; padding: 10px; } .facts > h2 { font-size: 20px; } .facts li { margin-bottom: 5px; } .footer { grid-area: footer; background-color: #0099cc; color: #ffffff; text-align: center; } ``` **Complete HTML** [S1] ```html

Chania

The City

Chania is the capital of the Chania region on the island of Crete.

The city can be divided in two parts, the old town and the modern city. The old town is situated next to the old harbour and is the matrix around which the whole urban area was developed.

Chania lies along the north west coast of the island Crete.

Facts:

``` By default this single-column stacking layout (header, menu, main, facts, footer) is the mobile/base view; the next chapter adds media queries and breakpoints to rearrange these areas for larger screens. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) The "Chania" travel page above is the page's own complete applied example β€” a grid container with header, menu, content, facts, and footer regions. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Named-area grid container (language: CSS): ```css .grid-container { display: grid; grid-template-areas: 'header' 'menu' 'main' 'facts' 'footer'; gap: 10px; } ``` Border-box reset (language: CSS): ```css * { box-sizing: border-box; } ``` ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. Note that this lesson teaches the grid using modern CSS Grid (`display: grid` + `grid-template-areas`) rather than a float-based 12-column system. [S1] ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.88 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS RWD Viewport]], [[CSS RWD Media Queries]], [[CSS Grid]] - **μ°Έμ‘° λ§₯락:** Establishes the page layout structure that media-query breakpoints later rearrange for different devices. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS RWD Grid View β€” https://www.w3schools.com/css/css_rwd_grid.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS RWD Grid View" page (Astra wiki-curation, P-Reinforce v3.1 format).