--- id: howto-css-alert-buttons title: "How To - Alert Buttons" category: "Web_Recipes" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["success info warning danger buttons"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.83 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["howto", "css", "w3schools", "buttons"] raw_sources: ["https://www.w3schools.com/howto/howto_css_alert_buttons.asp"] applied_in: [] github_commit: "" --- # [[HOWTO CSS Alert Buttons]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) A shared `.btn` base class handles all the STRUCTURAL styling (border removal, padding, cursor) once, while five separate semantic modifier classes (`.success`, `.info`, `.warning`, `.danger`, `.default`) each carry ONLY a background-color pair (normal + `:hover`) β€” this base+modifier split means adding a sixth alert color later requires just one new 2-line modifier class, not a full button redefinition. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Shared base class `.btn`** β€” `border: none; color: white; padding: 14px 28px; cursor: pointer;` applied once to every alert button. [S1] - **Color-coded semantic modifiers** β€” `.success` (green), `.info` (blue), `.warning` (orange), `.danger` (red), `.default` (gray, with black text instead of white). [S1] - **Each modifier defines its own `:hover`** β€” a slightly darker shade of the same hue, applied consistently across all five variants. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - HTML: `` (and similarly for info/warning/danger/default). [S1] - CSS colors: success `#04AA6D`β†’hover `#46a049`; info `#2196F3`β†’hover `#0b7dda`; warning `#ff9800`β†’hover `#e68a00`; danger `#f44336`β†’hover `#da190b`; default `#e7e7e7` (black text)β†’hover `#ddd`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) μ—†μŒ β€” μ‹ κ·œ λ ˆμ‹œν”Ό, κΈ°μ‘΄ λ¬Έμ„œμ™€ λͺ¨μˆœλ˜λŠ” λ‚΄μš© μ—†μŒ. ## πŸ› οΈ 적용 사둀 (Applied in summary) Success/Info/Warning/Danger/Default 5κ°€μ§€ μƒ‰μƒμ˜ μ•Œλ¦Ό λ²„νŠΌμ„ ν•˜λ‚˜μ˜ 곡톡 .btn ν΄λž˜μŠ€μ™€ 색상별 μˆ˜μ‹ 클래슀둜 κ΅¬ν˜„ν•˜λŠ” μ˜ˆμ œκ°€ μ›λ¬Έμ—μ„œ 직접 μ œμ‹œλ¨. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Base class + semantic color modifiers (CSS): ```css .btn { border: none; color: white; padding: 14px 28px; cursor: pointer; } .success { background-color: #04AA6D; } .success:hover { background-color: #46a049; } .danger { background-color: #f44336; } .danger:hover { background-color: #da190b; } ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference) - **μ‹ λ’° 점수:** 0.83 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[W3Schools HOW TO]] - **κ΄€λ ¨ κ°œλ…:** [[HOWTO CSS Block Buttons]], [[HOWTO CSS Outline Buttons]], [[HOWTO CSS Text Buttons]] - **μ°Έμ‘° λ§₯락:** CSS Buttons μ„Ήμ…˜. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” How To - Alert Buttons β€” https://www.w3schools.com/howto/howto_css_alert_buttons.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "How To - Alert Buttons" recipe (Astra wiki-curation, P-Reinforce v3.1 format).