--- id: howto-css-text-buttons title: "How To - Text Buttons" category: "Web_Recipes" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["ghost text button CSS", "background-color inherit"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.81 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_text_buttons.asp"] applied_in: [] github_commit: "" --- # [[HOWTO CSS Text Buttons]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) `background-color: inherit;` is the key trick that makes a "text button" invisible-as-a-button in its resting state β€” rather than setting an explicit background (even `white` or `transparent`, which would still create a visible box against certain page backgrounds), inheriting the PARENT's background color guarantees the button visually blends into whatever surface it sits on, making it look like plain colored text until hovered; this is the THIRD distinct button color-scheme this cookbook has shown for the same five semantic names (success/info/warning/danger/default), after Alert Buttons (solid fill) and Outline Buttons (bordered, inverts on hover) β€” text buttons are the "no fill, no border" endpoint of that same progression. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`background-color: inherit`** β€” takes on whatever background color the button's PARENT has, making the button invisible as a distinct shape until interacted with. [S1] - **`border: none`** β€” removes the outline entirely, unlike the Outline Buttons variant. [S1] - **Two hover variants** β€” a shared neutral hover (`background: #eee;` for ALL variants) OR per-variant colored hover (each semantic class gets its OWN hover background, matching its Alert Buttons counterpart color). [S1] - **Third point in the fill/border/text progression** β€” Alert Buttons (solid fill always) β†’ Outline Buttons (border, fills on hover) β†’ Text Buttons (no fill, no border, colored text only). [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Shared neutral hover: `.btn { border: none; background-color: inherit; } .btn:hover { background: #eee; } .success { color: green; }`. [S1] - Per-variant colored hover: `.success:hover { background-color: #04AA6D; color: white; }` (matches Alert Buttons' success color exactly). [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) - **fill/border/text 3단계 μ§„ν–‰μ˜ λ§ˆμ§€λ§‰ 지점**: `[[HOWTO CSS Alert Buttons]]`(항상 λ°°κ²½ 채움) β†’ `[[HOWTO CSS Outline Buttons]]`(ν…Œλ‘λ¦¬λ§Œ, hover μ‹œ μ±„μ›Œμ§) β†’ 이 λ ˆμ‹œν”Ό(λ°°κ²½ μ—†μŒ, hover μ‹œμ—λ§Œ 색상 λ“±μž₯)둜 μ΄μ–΄μ§€λŠ” 3단계 색상 μŠ€ν‚΄ μ§„ν–‰μ˜ λ§ˆμ§€λ§‰ λ‹¨κ³„λΌλŠ” 점이 확인됨 β€” λ™μΌν•œ 5개 μ‹œλ§¨ν‹± 이름(success/info/warning/danger/default)에 μ„Έ κ°€μ§€ λ‹€λ₯Έ μ‹œκ°μ  무게λ₯Ό μ μš©ν•˜λŠ” μ…ˆ. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) 배경이 μ—†μ–΄ ν‰λ²”ν•œ ν…μŠ€νŠΈμ²˜λŸΌ 보이닀가 hover μ‹œ 색이 μ±„μ›Œμ§€λŠ” 5κ°€μ§€ μ‹œλ§¨ν‹± λ²„νŠΌ μ˜ˆμ œκ°€ μ›λ¬Έμ—μ„œ 직접 μ œμ‹œλ¨. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Text button β€” invisible fill via background-color:inherit (CSS): ```css .btn { border: none; background-color: inherit; /* blends into parent background */ padding: 14px 28px; } .success { color: green; } .success:hover { background-color: #04AA6D; color: white; } ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference) - **μ‹ λ’° 점수:** 0.81 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[W3Schools HOW TO]] - **κ΄€λ ¨ κ°œλ…:** [[HOWTO CSS Alert Buttons]], [[HOWTO CSS Outline Buttons]] - **μ°Έμ‘° λ§₯락:** CSS Buttons μ„Ήμ…˜μ˜ λ§ˆμ§€λ§‰ 챕터. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” How To - Text Buttons β€” https://www.w3schools.com/howto/howto_css_text_buttons.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "How To - Text Buttons" recipe (Astra wiki-curation, P-Reinforce v3.1 format).