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