Files
2nd/10_Wiki/Topic_CSS/CSS_Buttons_Hover.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

129 lines
4.5 KiB
Markdown

---
id: css-button-hover-effects
title: "CSS Button Hover Effects"
category: "Frontend"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["button hover", ":hover button", "hoverable buttons", "button shadow", "disabled button", "button width"]
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", "buttons", "hover", "ui"]
raw_sources: ["https://www.w3schools.com/css/css3_buttons_hover.asp"]
applied_in: []
github_commit: ""
---
# [[CSS Button Hover Effects]]
## 🎯 한 줄 통찰 (One-line insight)
The `:hover` pseudo-class changes a button's appearance on mouse-over, and combined with `transition-duration`, `box-shadow`, `opacity`, and `width` it produces hover, shadow, disabled, and full-width button effects. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`:hover` pseudo-class** — used to change the style of a button when you mouse over it. [S1]
- **`transition-duration`** — added to the base button so the hover change animates smoothly. [S1]
- **`box-shadow`** — adds a shadow to a button (always-on or on hover). [S1]
- **`opacity`** — adds transparency to create a "disabled" look (paired with `cursor: not-allowed`). [S1]
- **`width`** — defines a specific width for a button. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Animated hover** — set `transition-duration` on `.button` and override `background-color`/`color` in `.button:hover`. [S1]
- **Shadow on hover vs always** — `.button1` carries a permanent shadow; `.button2:hover` shows the shadow only on hover. [S1]
- **Disabled look** — combine reduced `opacity` with `cursor: not-allowed`. [S1]
- **Sizing** — set width in px (`250px`), percentage of parent (`50%`), or full width (`100%`). [S1]
## 📖 세부 내용 (Details)
**Hoverable buttons** — the CSS `:hover` pseudo-class is used to change the style of a button when you mouse over it. [S1]
```css
.button {
transition-duration: 0.4s;
}
.button:hover {
background-color: #4CAF50; /* Green */
color: white;
}
```
**Buttons with shadow** — the CSS `box-shadow` property is used to add a shadow to a button. `.button1` has a permanent shadow; `.button2` shows a shadow only on hover. [S1]
```css
.button1 {
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.6);
}
.button2:hover {
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.6);
}
```
**Disabled button** — the CSS `opacity` property can be used to add transparency to a button (creates a "disabled" look). [S1]
```css
.disabledbtn {
opacity: 0.6;
cursor: not-allowed;
}
```
**Button width** — the CSS `width` property can be used to define a specific width for a button. By default, the size of a button is determined by its text content. [S1]
```css
.button1 {
width: 250px;
}
.button2 {
width: 50%;
}
.button3 {
width: 100%;
}
```
## 🛠️ 적용 사례 (Applied in summary)
The page's own examples are the applied cases: an animated `:hover` color swap, permanent vs hover-only `box-shadow`, a `.disabledbtn` style, and fixed/percentage/full-width button widths. No external project/commit applications found in the source.
## 💻 코드 패턴 (Code patterns)
Animated hover color change (language: CSS):
```css
.button {
transition-duration: 0.4s;
}
.button:hover {
background-color: #4CAF50;
color: white;
}
```
Show shadow only on hover (language: CSS):
```css
.button2:hover {
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.6);
}
```
## ⚖️ 모순 및 업데이트 (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 Styling Buttons]], [[CSS Box Shadow]], [[CSS Pseudo-classes]]
- **참조 맥락:** Referenced when adding interactive hover, shadow, disabled, or width behavior to styled buttons.
## 📚 출처 (Sources)
- [S1] W3Schools — CSS Button Hover Effects — https://www.w3schools.com/css/css3_buttons_hover.asp
## 📝 변경 이력 (Change history)
- 2026-06-23: Initial draft synthesized from the W3Schools "CSS Button Hover Effects" page (Astra wiki-curation, P-Reinforce v3.1 format).