--- id: css-overflow title: "CSS Overflow" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["overflow", "CSS overflow", "overflow visible", "overflow hidden", "overflow scroll", "overflow auto", "clipping content"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.89 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "overflow", "layout"] raw_sources: ["https://www.w3schools.com/css/css_overflow.asp"] applied_in: [] github_commit: "" --- # [[CSS Overflow]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The CSS `overflow` property controls what happens to content that is too big to fit its box β€” whether to clip it or add scrollbars β€” via four values: `visible`, `hidden`, `scroll`, and `auto`. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **purpose** β€” the `overflow` property controls what happens to content that is too big to fit into an area; it specifies whether to clip the content or add scrollbars when content is too big. [S1] - **visible (default)** β€” the overflow is not clipped; the content renders outside the element's box. [S1] - **hidden** β€” the overflow is clipped, and the rest of the content is hidden. [S1] - **scroll** β€” scrollbars are added; the user must scroll to see all content. [S1] - **auto** β€” similar to `scroll`, but adds scrollbars only when necessary. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Contain runaway content** β€” set `overflow: hidden` (clip) or `overflow: auto` (scroll only when needed) on a fixed-size box to keep oversized content within bounds. [S1] - **Always-vs-conditional scrollbars** β€” `scroll` always shows scrollbars; `auto` shows them only when content actually overflows. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **Overview** [S1] The CSS `overflow` property controls what happens to content that is too big to fit into an area. It specifies whether to clip the content or to add scrollbars when the content of an element is too big. **The four overflow values** [S1] 1. **visible** β€” Default. The overflow is not clipped. The content renders outside the element's box. 2. **hidden** β€” The overflow is clipped, and the rest of the content is hidden. 3. **scroll** β€” Scrollbars are added. User must scroll to see all content. 4. **auto** β€” Similar to `scroll`, but adds scrollbars only when necessary. **Example 1: overflow: visible** [S1] ```css div { width: 200px; height: 65px; background-color: coral; overflow: visible; } ``` **Example 2: overflow: hidden** [S1] ```css div { overflow: hidden; } ``` **Example 3: overflow: scroll** [S1] ```css div { overflow: scroll; } ``` **Example 4: overflow: auto** [S1] ```css div { overflow: auto; } ``` **CSS Overflow Properties Table** [S1] | Property | Description | |----------|-------------| | overflow | Specifies what happens if content overflows an element's box | | overflow-anchor | Makes it possible to turn off scroll anchoring | | overflow-x | Specifies what to do with the left/right edges of the content if it overflows the element's content area | | overflow-y | Specifies what to do with the top/bottom edges of the content if it overflows the element's content area | | overflow-wrap | Specifies whether or not the browser can break lines with long words, if they overflow its container | ## πŸ› οΈ 적용 사둀 (Applied in summary) The page applies all four values to a fixed-size `div` (200px Γ— 65px, coral background): `visible` lets content spill out, `hidden` clips it, `scroll` always shows scrollbars, and `auto` shows scrollbars only when needed. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Clip overflowing content (language: CSS): ```css div { overflow: hidden; } ``` Add scrollbars only when needed (language: CSS): ```css div { overflow: auto; } ``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) - **visible** β€” default; content overflows the box and is shown. [S1] - **hidden** β€” content is clipped and the excess is hidden (no scrollbars). [S1] - **scroll** β€” scrollbars are always present, even if not needed. [S1] - **auto** β€” scrollbars appear only when content overflows; choose this for the cleanest conditional scrolling. [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.89 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Overflow X and Y]], [[CSS Position Fixed and Absolute]], [[CSS Float]] - **μ°Έμ‘° λ§₯락:** Referenced whenever content may exceed a fixed-size container and must be clipped or scrolled. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Overflow β€” https://www.w3schools.com/css/css_overflow.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Overflow" page (Astra wiki-curation, P-Reinforce v3.1 format).