--- id: css-background-origin title: "CSS Background Origin" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["background-origin", "padding-box", "border-box origin", "content-box origin", "background positioning area", "background image start"] 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-origin"] raw_sources: ["https://www.w3schools.com/css/css3_background_origin.asp"] applied_in: [] github_commit: "" --- # [[CSS Background Origin]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The `background-origin` property specifies where the background image is positioned relative to the box model β€” starting from the padding edge (default), the border edge, or the content edge. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`background-origin`** β€” specifies where the background image is positioned. [S1] - **`padding-box`** β€” the background image starts from the top-left corner of the padding edge; this is the default. [S1] - **`border-box`** β€” the background image starts from the top-left corner of the border edge. [S1] - **`content-box`** β€” the background image starts from the top-left corner of the content edge. [S1] - **Fixed-attachment caveat** β€” this property has no effect if `background-attachment` is set to `fixed`. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Box-model anchor pattern** β€” the chosen value (`padding-box` / `border-box` / `content-box`) selects which box-model edge the image's top-left corner aligns to. [S1] - **Default-vs-inset pattern** β€” `border-box` lets the image extend out under the border, while `content-box` insets it past the padding. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **CSS `background-origin` Property** The `background-origin` property specifies where the background image is positioned. [S1] The property takes three different values: [S1] - `padding-box` β€” the background image starts from the top-left corner of the padding edge. This is default. [S1] - `border-box` β€” the background image starts from the top-left corner of the border edge. [S1] - `content-box` β€” the background image starts from the top-left corner of the content edge. [S1] **Note:** This property has no effect if the `background-attachment` property is set to `fixed`. [S1] Example β€” the three origin values across three divs: [S1] ```css #div1 { border: 2px solid black; padding: 35px; background-image: url(img_flwr.gif); background-repeat: no-repeat; background-origin: padding-box; } #div2 { border: 2px solid black; padding: 35px; background-image: url(img_flwr.gif); background-repeat: no-repeat; background-origin: border-box; } #div3 { border: 2px solid black; padding: 35px; background-image: url(img_flwr.gif); background-repeat: no-repeat; background-origin: 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 origin value relative to the box model: [S1] - **`padding-box`** (default) β€” image's top-left aligns to the padding edge; the usual behavior. - **`border-box`** β€” image starts at the border edge, so it appears under the border. - **`content-box`** β€” image starts at the content edge, inset past both border and padding. Note these only affect positioning of the image's origin; with `background-attachment: fixed`, the property has no effect. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's three-div example (identical flower image with `padding-box`, `border-box`, and `content-box`) is the applied case. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Anchor the background image to the content edge (language: CSS): ```css selector { border: 2px solid black; padding: 35px; background-image: url(img_flwr.gif); background-repeat: no-repeat; background-origin: 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 Clip]], [[CSS Background Size]], [[CSS Multiple Backgrounds]] - **μ°Έμ‘° λ§₯락:** Referenced when controlling exactly where a background image begins relative to border and padding. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Background Origin β€” https://www.w3schools.com/css/css3_background_origin.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Background Origin" page (Astra wiki-curation, P-Reinforce v3.1 format).