--- id: css-background-clip title: "CSS Background Clip" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["background-clip", "background painting area", "border-box clip", "padding-box clip", "content-box clip", "background extent"] 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", "background", "background-clip"] raw_sources: ["https://www.w3schools.com/css/css3_background_clip.asp"] applied_in: [] github_commit: "" --- # [[CSS Background Clip]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The `background-clip` property defines how far the background (color, image, or gradient) extends within an element β€” behind the border (default), to the inside edge of the border, or only to the content box. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`background-clip`** β€” defines how far the background (color, image, or gradient) should extend within an element. [S1] - **`border-box`** β€” the background extends behind the border; this is the default. [S1] - **`padding-box`** β€” the background extends to the inside edge of the border. [S1] - **`content-box`** β€” the background extends to the edge of the content box. [S1] - **Applies to color and image** β€” the same values work whether the background is a color or an image. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Clip-extent pattern** β€” the value sets the outer boundary of the painted area: `border-box` β†’ `padding-box` β†’ `content-box` progressively shrinks where the background shows. [S1] - **Border-reveal pattern** β€” with a dotted/transparent border, switching to `padding-box` or `content-box` makes the background stop short of (and reveal gaps in) the border area. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **CSS `background-clip` Property** The `background-clip` property defines how far the background (color, image, or gradient) should extend within an element. [S1] The property takes three different values: [S1] - `border-box` β€” the background extends behind the border. This is default. [S1] - `padding-box` β€” the background extends to the inside edge of the border. [S1] - `content-box` β€” the background extends to the edge of the content box. [S1] Example β€” `background-clip` with a background image: [S1] ```css #div1 { border: 5px dotted black; padding: 35px; background-image: url(paper.gif); background-clip: border-box; } #div2 { border: 5px dotted black; padding: 35px; background-image: url(paper.gif); background-clip: padding-box; } #div3 { border: 5px dotted black; padding: 35px; background-image: url(paper.gif); background-clip: content-box; } ``` Example β€” `background-clip` with a background color: [S1] ```css #div1 { border: 5px dotted black; padding: 35px; background-color: lightblue; background-clip: border-box; } #div2 { border: 5px dotted black; padding: 35px; background-color: lightblue; background-clip: padding-box; } #div3 { border: 5px dotted black; padding: 35px; background-color: lightblue; background-clip: content-box; } ``` **CSS Background Properties** | Property | Description | |----------|-------------| | `background` | A shorthand property for setting all the background properties in one declaration | | `background-clip` | Specifies the painting area of the background | | `background-image` | Specifies one or more background images for an element | | `background-origin` | Specifies where the background image(s) is/are positioned | | `background-size` | Specifies the size of the background image(s) | [S1] ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) Choosing the clip extent (paint boundary): [S1] - **`border-box`** (default) β€” background paints all the way behind the border; useful so a dotted/transparent border shows the background through its gaps. - **`padding-box`** β€” background stops at the inner edge of the border, leaving the border area unpainted. - **`content-box`** β€” background paints only within the content box, leaving both border and padding areas unpainted. Note `background-clip` controls the painted area, whereas [[CSS Background Origin]] controls the image's starting position. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's two example sets (the same dotted-border, padded box with `border-box`/`padding-box`/`content-box` applied to a background image and then to a background color) are the applied cases. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Clip the background color to the content box (language: CSS): ```css selector { border: 5px dotted black; padding: 35px; background-color: lightblue; background-clip: content-box; } ``` ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (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 Background Origin]], [[CSS Background Size]], [[CSS Multiple Backgrounds]] - **μ°Έμ‘° λ§₯락:** Referenced when controlling whether a background shows behind the border, only inside it, or only within the content area. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Background Clip β€” https://www.w3schools.com/css/css3_background_clip.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Background Clip" page (Astra wiki-curation, P-Reinforce v3.1 format).