--- id: css-grid-12-column-layout title: "CSS Grid 12-column Layout" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["12-column grid", "repeat(12, 1fr)", "responsive grid layout", "mobile first grid", "named grid lines", "col-start grid", "12 column responsive"] 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", "grid", "responsive"] raw_sources: ["https://www.w3schools.com/css/css_grid_12column.asp"] applied_in: [] github_commit: "" --- # [[CSS Grid 12-column Layout]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) A 12-column grid divides horizontal space into 12 equal fluid `1fr` columns via `grid-template-columns: repeat(12, [col-start] 1fr)`, and because 12 is highly divisible, items can be placed and resized with `grid-column` spans and progressively rearranged through mobile-first media queries. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **12-column grid** β€” a common and flexible method for structuring web page content, particularly for responsive web design. [S1] - **Equal-width division** β€” the system divides the available horizontal space into 12 equal-width columns, allowing precise placement and sizing of elements. [S1] - **Flexibility** β€” 12 is highly divisible, so designers can create halves, thirds, and quarters (2 columns of 6, 3 columns of 4, 4 columns of 3). [S1] - **Responsiveness** β€” a 12-column grid is ideal for building responsive websites that adapt to different screen sizes (desktop, tablet, or mobile) with media queries. [S1] - **Efficiency** β€” having a pre-defined structure speeds up the design process. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **`repeat(12, [col-start] 1fr)`** β€” `repeat(12,..)` repeats the track definition 12 times; `[col-start]` creates a named grid line useful for placing items at specific start points; `1fr` is a fractional unit giving each column an equal, fluid width. [S1] - **Item placement options** β€” place/size items with `grid-column: span ;`, `grid-column: / span ;`, or `grid-column: / ;`. [S1] - **Mobile-first media queries** β€” design for mobile first, showing sections in source order for small screens, then enhance at 576px and 768px breakpoints. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) A 12-column grid is a common and flexible method for structuring web page content, particularly for responsive web design. The 12-column grid system divides the available horizontal space into 12 equal-width columns, allowing for precise placement and sizing of elements within the layout. [S1] **Benefits** [S1] - **Flexibility:** the number 12 is highly divisible. Designers can easily create designs with halves, thirds, and quarters (2 columns of 6, 3 columns of 4, 4 columns of 3). - **Responsiveness:** a 12-column grid is ideal for building responsive websites that adapt to different screen sizes (desktop, tablet, or mobile) with media queries. - **Efficiency:** having a pre-defined structure speeds up the design process. **Implementation** [S1] - **Define grid container:** apply `display: grid;` to the container element. - **Create 12 columns:** use `grid-template-columns: repeat(12, [col-start] 1fr);`, where `repeat(12,..)` tells the grid to repeat the following track definition 12 times (resulting in 12 columns), `[col-start]` creates a named grid line (useful for placing grid items at specific start points), and `1fr` is a fractional unit that represents one fraction of the total available space (so each of the 12 columns will be an equal, fluid width). - **Place grid items:** grid items can then be placed and sized across these 12 columns using `grid-column`, via `grid-column: span ;`, `grid-column: / span ;`, or `grid-column: / ;`. - **Media queries:** always design for mobile first. Display the sections in the source order (from top to bottom) for screens less than 576 pixels wide, then enhance at 576px and 768px breakpoints. [S1] **Complete example** [S1] ```css * { box-sizing: border-box; } .container { display: grid; grid-template-columns: repeat(12, [col-start] 1fr); gap: 20px; } nav ul { list-style: none; margin: 0; padding: 0; } /* Mobile first */ .container > * { border: 1px solid green; background-color: beige; padding: 10px; grid-column: col-start / span 12; } @media (min-width: 576px) { .sidebar { grid-column: col-start / span 3; grid-row: 3; } .ads { grid-column: col-start / span 3; } .content, .footer { grid-column: col-start 4 / span 9; } nav ul { display: flex; justify-content: space-between; } } @media (min-width: 768px) { .nav { grid-column: col-start / span 2; grid-row: 2 / 4; } .content { grid-column: col-start 3 / span 8; grid-row: 2 / 4; } .sidebar { grid-column: col-start 11 / span 2; } .ads { grid-column: col-start 11 / span 2; } .footer { grid-column: col-start / span 12; } nav ul { flex-direction: column; } } ``` ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's applied case is a complete responsive page layout: a 12-column container with `gap: 20px`, full-width stacking on mobile, a 3/9 split at 576px, and a nav/content/sidebar/ads/footer arrangement at 768px. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Define a 12-column fluid grid (language: CSS): ```css .container { display: grid; grid-template-columns: repeat(12, [col-start] 1fr); gap: 20px; } ``` Mobile-first full-width default, then span at a breakpoint: ```css .container > * { grid-column: col-start / span 12; } @media (min-width: 576px) { .content, .footer { grid-column: col-start 4 / span 9; } } ``` ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.88 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Grid Items]], [[CSS Grid Item Named]], [[CSS RWD Intro]] - **μ°Έμ‘° λ§₯락:** A concrete responsive layout method built on CSS Grid and media queries. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Grid 12-column Layout β€” https://www.w3schools.com/css/css_grid_12column.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Grid 12-column Layout" page (Astra wiki-curation, P-Reinforce v3.1 format).