--- id: css-multiple-backgrounds title: "CSS Multiple Backgrounds" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["multiple backgrounds", "background-image list", "stacked backgrounds", "CSS3 backgrounds", "comma-separated backgrounds", "background shorthand"] 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-image"] raw_sources: ["https://www.w3schools.com/css/css3_backgrounds.asp"] applied_in: [] github_commit: "" --- # [[CSS Multiple Backgrounds]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) CSS allows multiple background images on a single element via a comma-separated list on `background-image`, with the images stacked so the first one listed sits closest to the viewer. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Multiple images** β€” CSS allows you to add multiple background images for an element through the `background-image` property. [S1] - **Comma separation** β€” the different background images are separated by commas. [S1] - **Stacking order** β€” the images are stacked on top of each other, where the first image is closest to the viewer. [S1] - **Shorthand** β€” the `background` shorthand can declare each image's position and repeat behavior in a single property. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Parallel-list pattern** β€” `background-image`, `background-position`, and `background-repeat` each take a comma-separated list whose items correspond positionally to each image. [S1] - **Shorthand-collapse pattern** β€” the same multi-image setup can be collapsed into one `background` declaration per image, comma-separated. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **CSS Multiple Backgrounds** CSS allows you to add multiple background images for an element, through the `background-image` property. The different background images are separated by commas, and the images are stacked on top of each other, where the first image is closest to the viewer. [S1] The tutorial demonstrates this with two images: a flower aligned to the bottom-right and a paper-like background at the top-left. [S1] Example β€” using the individual background properties: [S1] ```css #example1 { background-image: url(img_flwr.gif), url(paper.gif); background-position: right bottom, left top; background-repeat: no-repeat, repeat; } ``` Example β€” using the `background` shorthand property: [S1] ```css #example1 { background: url(img_flwr.gif) right bottom no-repeat, url(paper.gif) left top repeat; } ``` Multiple background images can be specified using either the individual background properties (as above) or the `background` shorthand property. [S1] **CSS Advanced 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) The same multi-image background can be written two ways: [S1] - **Individual properties** (`background-image` + `background-position` + `background-repeat` lists) β€” more explicit and readable when each image needs distinct position/repeat values that you want to scan separately. - **`background` shorthand** β€” more compact, grouping each image's URL, position, and repeat into one comma-separated entry. Both produce the same result; the choice is about verbosity vs. compactness. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's `#example1` (flower bottom-right over a repeating paper background, shown via both the longhand and shorthand forms) is the applied case. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Two stacked backgrounds via individual properties (language: CSS): ```css selector { background-image: url(img_flwr.gif), url(paper.gif); background-position: right bottom, left top; background-repeat: no-repeat, repeat; } ``` Same result via shorthand: ```css selector { background: url(img_flwr.gif) right bottom no-repeat, url(paper.gif) left top repeat; } ``` ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (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 Size]], [[CSS Background Origin]], [[CSS Background Clip]] - **μ°Έμ‘° λ§₯락:** Referenced when layering textures, overlays, or decorative images behind content in a single element. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Multiple Backgrounds β€” https://www.w3schools.com/css/css3_backgrounds.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Multiple Backgrounds" page (Astra wiki-curation, P-Reinforce v3.1 format).