--- id: howto-css-notification-button title: "How To - Notification Buttons" category: "Web_Recipes" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["badge count button CSS"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.82 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["howto", "css", "w3schools", "buttons", "badge"] raw_sources: ["https://www.w3schools.com/howto/howto_css_notification_button.asp"] applied_in: [] github_commit: "" --- # [[HOWTO CSS Notification Button]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The count badge is positioned with NEGATIVE offsets (`top: -10px; right: -10px;`) rather than the usual `0`/positive values seen in other absolute-positioning recipes β€” this deliberately pushes the badge PARTLY OUTSIDE the parent button's boundary box, creating the familiar "peeking over the corner" notification-count look, which only works because `.notification { position: relative; }` gives the badge a positioning anchor to escape from in the first place. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`position: relative` on the button** β€” establishes the anchor for the badge's absolute positioning, same relative/absolute pairing seen throughout this cookbook. [S1] - **Negative `top`/`right` offsets** β€” `top: -10px; right: -10px;` deliberately pushes the badge outside the button's own box, rather than flush against an inner edge. [S1] - **`border-radius: 50%` badge** β€” combined with roughly-equal padding to render as a circle around the count number. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - `.notification { background-color: #555; position: relative; display: inline-block; } .notification .badge { position: absolute; top: -10px; right: -10px; border-radius: 50%; background: red; color: white; }`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) μ—†μŒ β€” μ‹ κ·œ λ ˆμ‹œν”Ό, κΈ°μ‘΄ λ¬Έμ„œμ™€ λͺ¨μˆœλ˜λŠ” λ‚΄μš© μ—†μŒ. ## πŸ› οΈ 적용 사둀 (Applied in summary) "Inbox" λ²„νŠΌ 였λ₯Έμͺ½ 상단 λͺ¨μ„œλ¦¬μ— λΉ¨κ°„ μ›ν˜• λ°°μ§€λ‘œ "3"을 ν‘œμ‹œν•˜λŠ” μ˜ˆμ œκ°€ μ›λ¬Έμ—μ„œ 직접 μ œμ‹œλ¨. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Notification badge escaping the button's own box via negative offsets (CSS): ```css .notification { position: relative; display: inline-block; } .notification .badge { position: absolute; top: -10px; right: -10px; /* negative -- pushes outside the button */ border-radius: 50%; background: red; color: white; } ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference) - **μ‹ λ’° 점수:** 0.82 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[W3Schools HOW TO]] - **κ΄€λ ¨ κ°œλ…:** [[HOWTO CSS Icon Buttons]], [[HOWTO CSS Ribbon]] - **μ°Έμ‘° λ§₯락:** CSS Buttons μ„Ήμ…˜. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” How To - Notification Buttons β€” https://www.w3schools.com/howto/howto_css_notification_button.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "How To - Notification Buttons" recipe (Astra wiki-curation, P-Reinforce v3.1 format).