--- id: css-background-shorthand title: "CSS Background Shorthand" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["background shorthand", "background property", "CSS background shorthand", "shorthand background", "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", "shorthand"] raw_sources: ["https://www.w3schools.com/css/css_background_shorthand.asp"] applied_in: [] github_commit: "" --- # [[CSS Background Shorthand]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) To shorten the code, the `background` shorthand property lets you specify all the background properties in one single declaration. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **background shorthand** β€” to shorten the code, it is possible to specify all the background properties in one single property. [S1] - **Replaces longhand** β€” a single `background:` declaration can replace separate `background-color`, `background-image`, `background-repeat`, and `background-position` declarations. [S1] - **Constituent properties** β€” the page lists the individual properties the shorthand can combine: `background-attachment`, `background-clip`, `background-color`, `background-image`, `background-origin`, `background-position`, `background-repeat`, and `background-size`. [S1] - **Omitted values** β€” if some property values are missing, they will be set to their initial (default) values. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Collapse the longhand** β€” replace a block of `background-*` declarations with one `background:` line for brevity. [S1] - **Rely on defaults** β€” only list the values you need; omitted ones fall back to their initial values. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **Background - Shorthand property** To shorten the code, it is also possible to specify all the background properties in one single property. This is called a shorthand property. [S1] Instead of writing the properties separately: [S1] ```css body { background-color: #ffffff; background-image: url("img_tree.png"); background-repeat: no-repeat; background-position: right top; } ``` You can use the shorthand `background` property: [S1] ```css body { background: #ffffff url("img_tree.png") no-repeat right top; } ``` The shorthand `background` property can combine the following individual background properties: [S1] - `background-attachment` - `background-clip` - `background-color` - `background-image` - `background-origin` - `background-position` - `background-repeat` - `background-size` If some of the property values are missing, they will be set to their initial (default) values. [S1] **Order of values:** The page does not explicitly prescribe a required ordering of the values; the example writes them as color, image, repeat, then position (`#ffffff url("img_tree.png") no-repeat right top`). An explicit ordering rule was: Not found in source. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) The longhand and shorthand `body` rules above are the page's own demonstration examples. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Background shorthand (language: CSS): ```css selector { background: #ffffff url("img_tree.png") no-repeat right top; } ``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) - **Longhand vs shorthand** β€” separate `background-*` declarations are explicit and easy to read property by property; the `background` shorthand is more compact and sets any unspecified values to their initial defaults. Choose the shorthand to shorten the code. [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.88 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Background Color]], [[CSS Background Image]], [[CSS Background Repeat]], [[CSS Background Attachment]] - **μ°Έμ‘° λ§₯락:** Referenced when collapsing multiple background-* declarations into one concise rule. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Background Shorthand β€” https://www.w3schools.com/css/css_background_shorthand.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Background Shorthand" page (Astra wiki-curation, P-Reinforce v3.1 format).