Files
2nd/10_Wiki/Topic_CSS/CSS_Box_Shadow.md
T
koriweb 9609c04755 docs(10_Wiki): W3Schools 위키화 — HTML/CSS/JavaScript(core)
W3Schools 튜토리얼을 P-Reinforce v3.1 포맷으로 위키화(영어 본문, 한/영 섹션 헤더).
- Topic_HTML: 59문서 (튜토리얼+예제, 레퍼런스/메타 제외)
- Topic_CSS: 190문서 (메인 + Advanced/Flexbox/Grid/RWD 전체)
- Topic_JavaScript: 120문서 (코어 언어; Temporal/DOM상세/BOM/WebAPI/AJAX/jQuery/Graphics 등은 후속)
각 폴더 00_INDEX.md(MOC) 포함. 코드 verbatim, 미확인분은 "Not found in source" 표기.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 19:21:18 +09:00

151 lines
5.2 KiB
Markdown

---
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).