--- id: css-box-shadow title: "CSS Box Shadow" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["box-shadow", "CSS box shadow", "card shadow CSS", "inset shadow", "drop shadow element"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.9 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "box-shadow", "shadows", "cards"] raw_sources: ["https://www.w3schools.com/css/css3_shadows_box.asp"] applied_in: [] github_commit: "" --- # [[CSS Box Shadow]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The `box-shadow` property attaches one or more shadows to an element using horizontal/vertical offsets, with optional blur radius, spread radius, color, and an `inset` keyword β€” commonly used to make elements look like raised cards. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`box-shadow` shadows an element** β€” it applies one or more shadows to an element. [S1] - **Offsets are required** β€” the minimum form is a horizontal and a vertical offset. [S1] - **Blur radius** β€” an optional third value blurs the shadow. [S1] - **Spread radius** β€” an optional fourth value expands (or contracts) the shadow size. [S1] - **Color and `inset`** β€” you can set the shadow color, and the `inset` keyword changes the shadow from an outer to an inner shadow. [S1] - **Multiple shadows** β€” comma-separated shadows can be layered, which is how card effects are built. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Offset-only pattern** β€” `box-shadow: 10px 10px;`. [S1] - **Offset + color pattern** β€” `box-shadow: 10px 10px lightblue;`. [S1] - **Offset + blur (+ spread) pattern** β€” `box-shadow: 10px 10px 5px 12px lightblue;`. [S1] - **Inset pattern** β€” append `inset` for an inner shadow. [S1] - **Card pattern** β€” two stacked `rgba()` shadows to mimic a paper card. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **Basic horizontal and vertical shadow** [S1] The horizontal offset (10px) and the vertical offset (10px) are required: ```css div { box-shadow: 10px 10px; } ``` **Shadow with color** [S1] ```css div { box-shadow: 10px 10px lightblue; } ``` **Blur effect (third value = blur radius)** [S1] ```css div { box-shadow: 10px 10px 5px lightblue; } ``` **Spread radius (fourth value)** [S1] ```css div { box-shadow: 10px 10px 5px 12px lightblue; } ``` **Inset shadow** [S1] The `inset` keyword changes the shadow from an outer shadow to an inner shadow: ```css div { box-shadow: 10px 10px 5px lightblue inset; } ``` **Multiple shadows** [S1] You can add as many shadows as you like, separated by commas: ```css div { box-shadow: 5px 5px 8px blue, 10px 10px 8px red, 15px 15px 8px green; } ``` **Cards** [S1] You can use the `box-shadow` property to create paper-like cards: ```css div.card { width: 250px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); text-align: center; } ``` **Shadow Properties reference** [S1] The page includes a table listing the shadow properties `box-shadow` (adds shadows to elements) and `text-shadow` (adds shadows to text), with their descriptions. ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's own demonstrations (`div` elements showing offset, color, blur, spread, inset, multiple shadows, and the `div.card` paper-card effect) serve as the applied examples. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Blur + spread shadow (language: CSS): ```css div { box-shadow: 10px 10px 5px 12px lightblue; } ``` Inner (inset) shadow: ```css div { box-shadow: 10px 10px 5px lightblue inset; } ``` Paper-like card: ```css div.card { width: 250px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); text-align: center; } ``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) - **`box-shadow` vs `text-shadow`** β€” `box-shadow` shadows the whole element box; `text-shadow` shadows only the text glyphs. [S1] - **Outer vs inset shadow** β€” omit `inset` for a drop shadow that lifts the element; add `inset` for a recessed/inner shadow. [S1] - **Blur only vs blur + spread** β€” the third value blurs the shadow; the fourth (spread) value grows or shrinks the shadow's footprint. [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.90 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Text Shadow Effects]], [[CSS Radial Gradients]], [[CSS 2D Transforms]] - **μ°Έμ‘° λ§₯락:** Referenced when giving elements depth β€” cards, buttons, modals, and raised panels. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Box Shadow β€” https://www.w3schools.com/css/css3_shadows_box.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Box Shadow" page (Astra wiki-curation, P-Reinforce v3.1 format).