1cfd3bbb56
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고, Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
84 lines
4.5 KiB
Markdown
84 lines
4.5 KiB
Markdown
---
|
|
id: w3css-dropdowns
|
|
title: "W3CSS Dropdowns"
|
|
category: "Programming_Language"
|
|
status: "draft"
|
|
verification_status: "conceptual"
|
|
canonical_id: ""
|
|
aliases: ["w3-dropdown-hover", "w3-dropdown-click", "W3.CSS 드롭다운"]
|
|
duplicate_of: ""
|
|
source_trust_level: "B"
|
|
confidence_score: 0.87
|
|
created_at: 2026-07-04
|
|
updated_at: 2026-07-04
|
|
review_reason: ""
|
|
merge_history: []
|
|
tags: ["w3css", "css-framework", "w3schools", "dropdown", "navigation"]
|
|
raw_sources: ["https://www.w3schools.com/w3css/w3css_dropdowns.asp"]
|
|
applied_in: []
|
|
github_commit: ""
|
|
---
|
|
|
|
# [[W3CSS Dropdowns]]
|
|
|
|
## 🎯 한 줄 통찰 (One-line insight)
|
|
`w3-dropdown-hover` and `w3-dropdown-content` place NO constraint on element type — the source explicitly demonstrates the exact same dropdown behavior using `<button>`+`<div>`, then `<p>`+`<span>`, proving the pattern is a pure CSS relationship (hover state on parent reveals a positioned child), not tied to any specific semantic markup. [S1]
|
|
|
|
## 🧠 핵심 개념 (Core concepts)
|
|
- **`w3-dropdown-hover`** — marks an element as a hoverable dropdown trigger; any element type works. [S1]
|
|
- **`w3-dropdown-content`** — the content revealed on hover/click; hidden by default, shown via CSS `:hover` or JS-toggled class. [S1]
|
|
- **`w3-dropdown-click`** — clickable variant; requires JavaScript to explicitly toggle a `w3-show` class since there's no `:hover` state to rely on. [S1]
|
|
- **`w3-show`** — the class JS toggles on/off to reveal/hide click-based dropdown content. [S1]
|
|
- **Animation composability** — any `w3-animate-*` class can be added directly to `w3-dropdown-content` for a fade/zoom/slide reveal. [S1]
|
|
- **Right-aligned positioning** — combining `w3-right` (float) with inline `right:0` CSS makes the dropdown content open right-to-left instead of left-to-right. [S1]
|
|
|
|
## 📖 세부 내용 (Details)
|
|
- Hover dropdown with any element types: `<p class="w3-dropdown-hover">Hover over me!<span class="w3-dropdown-content w3-green">Hello World!</span></p>`. [S1]
|
|
- Click dropdown with JS toggle: `<div class="w3-dropdown-click"><button onclick="myFunction()" class="w3-button w3-black">Click Me!</button><div id="Demo" class="w3-dropdown-content w3-bar-block w3-border">...</div></div>` with `function myFunction() { var x = document.getElementById("Demo"); if (x.className.indexOf("w3-show") == -1) { x.className += " w3-show"; } else { x.className = x.className.replace(" w3-show", ""); } }`. [S1]
|
|
- Animated dropdown content: `<div id="Demo" class="w3-dropdown-content w3-bar-block w3-animate-zoom">`. [S1]
|
|
|
|
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
|
|
- **hover vs click 방식의 근본적 차이**: w3-dropdown-hover는 순수 CSS :hover로 동작하지만 w3-dropdown-click은 JavaScript로 w3-show 클래스를 수동 토글해야 한다는 구조적 차이가 있음. [S1]
|
|
|
|
## 🛠️ 적용 사례 (Applied in summary)
|
|
현재 발견된 실제 적용 사례가 없습니다 — 네비게이션 바 안에 드롭다운 메뉴를 넣는 조합이 다음 챕터(Navigation Bars)에서 본격적으로 다뤄지는 실전 활용의 시작점이다. [S1]
|
|
|
|
## 💻 코드 패턴 (Code patterns)
|
|
Clickable dropdown toggled via JavaScript's w3-show class (HTML/JS):
|
|
```html
|
|
<div class="w3-dropdown-click">
|
|
<button onclick="myFunction()" class="w3-button w3-black">Click Me!</button>
|
|
<div id="Demo" class="w3-dropdown-content w3-bar-block w3-border">
|
|
<a href="#" class="w3-bar-item w3-button">Link 1</a>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
function myFunction() {
|
|
var x = document.getElementById("Demo");
|
|
if (x.className.indexOf("w3-show") == -1) {
|
|
x.className += " w3-show";
|
|
} else {
|
|
x.className = x.className.replace(" w3-show", "");
|
|
}
|
|
}
|
|
</script>
|
|
```
|
|
|
|
## ✅ 검증 상태 및 신뢰도
|
|
- **상태:** draft
|
|
- **검증 단계:** conceptual
|
|
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
|
|
- **신뢰 점수:** 0.87
|
|
- **중복 검사 결과:** 신규 생성 (New discovery)
|
|
|
|
## 🔗 지식 그래프 (Knowledge Graph)
|
|
- **상위/루트:** [[W3.CSS Tutorial]]
|
|
- **관련 개념:** [[W3CSS Bars]], [[W3CSS Accordions]], [[W3CSS Navigation]]
|
|
- **참조 맥락:** hover/click 기반 콘텐츠 공개 패턴 — 아코디언(Accordions) 챕터와 직접 대비됨.
|
|
|
|
## 📚 출처 (Sources)
|
|
- [S1] W3Schools — W3.CSS Dropdowns — https://www.w3schools.com/w3css/w3css_dropdowns.asp
|
|
|
|
## 📝 변경 이력 (Change history)
|
|
- 2026-07-04: Initial draft synthesized from the W3Schools "W3.CSS Dropdowns" page (Astra wiki-curation, P-Reinforce v3.1 format).
|