--- id: howto-css-sidenav-buttons title: "How To - Side Navigation Buttons" category: "Web_Recipes" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["hoverable sidenav tabs 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", "navigation", "transition"] raw_sources: ["https://www.w3schools.com/howto/howto_css_sidenav_buttons.asp"] applied_in: [] github_commit: "" --- # [[HOWTO CSS Sidenav Buttons]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) Each link starts positioned OFF-SCREEN (`left: -80px`, wider than the link's own visible width) rather than hidden via `display: none` or `opacity: 0` β€” this specific choice is what allows the `transition: 0.3s` combined with `:hover { left: 0; }` to produce a smooth SLIDE-IN motion (the browser animates the `left` property's numeric change) instead of an instant appear/disappear, which opacity or display toggles could never animate the same way. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Off-screen starting position** β€” `left: -80px` (each tab's width is `100px`, so `-80px` leaves a 20px sliver visible as a "handle"). [S1] - **`transition: 0.3s`** β€” animates the `left` property change smoothly, rather than snapping instantly. [S1] - **`:hover { left: 0; }`** β€” slides the tab fully into view on hover. [S1] - **Stacked `top` offsets + individual colors per tab** β€” each of the four tabs (`#about`, `#blog`, `#projects`, `#contact`) has its own `top` value (20px, 80px, 140px, 200px) and background color, positioning them as a vertically-stacked column of colored tabs. [S1] - **`border-radius: 0 5px 5px 0`** β€” rounds only the RIGHT corners (top-right, bottom-right), since the left edge is meant to be flush against/hidden by the screen edge. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - `#mySidenav a { position: absolute; left: -80px; transition: 0.3s; width: 100px; border-radius: 0 5px 5px 0; } #mySidenav a:hover { left: 0; } #about { top: 20px; background-color: #04AA6D; }`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) - **display/opacity 토글이 μ•„λ‹ˆλΌ μœ„μΉ˜ μ• λ‹ˆλ©”μ΄μ…˜μœΌλ‘œ μŠ¬λΌμ΄λ“œ 효과λ₯Ό 냄**: λ‹€λ₯Έ hover-reveal λ ˆμ‹œν”Ό(예: `[[HOWTO CSS Button Split]]`)κ°€ `display: none β†’ block`으둜 μ¦‰μ‹œ λ‚˜νƒ€λ‚˜λŠ” λ°©μ‹μ΄μ—ˆλ‹€λ©΄, 이 λ ˆμ‹œν”ΌλŠ” μš”μ†Œλ₯Ό ν™”λ©΄ λ°–(`left: -80px`)에 미리 λ°°μΉ˜ν•΄λ‘κ³  `transition`으둜 μœ„μΉ˜λ₯Ό λΆ€λ“œλŸ½κ²Œ μ΄λ™μ‹œν‚¨λ‹€λŠ” 점이 확인됨 β€” display 토글은 μ• λ‹ˆλ©”μ΄μ…˜μ΄ λΆˆκ°€λŠ₯ν•˜μ§€λ§Œ μœ„μΉ˜(left) 값은 transition으둜 μ• λ‹ˆλ©”μ΄μ…˜ κ°€λŠ₯ν•˜κΈ° λ•Œλ¬Έ. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) About/Blog/Projects/Contact 4개의 색이 λ‹€λ₯Έ 탭이 ν™”λ©΄ μ™Όμͺ½μ— μ‚΄μ§λ§Œ 보이닀가, 마우슀λ₯Ό 올리면 λΆ€λ“œλŸ½κ²Œ λ―Έλ„λŸ¬μ Έ λ‚˜μ˜€λŠ” μ˜ˆμ œκ°€ μ›λ¬Έμ—μ„œ 직접 μ œμ‹œλ¨. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Off-screen tabs that slide in smoothly via transition (CSS): ```css #mySidenav a { position: absolute; left: -80px; /* off-screen, 20px sliver visible */ transition: 0.3s; width: 100px; border-radius: 0 5px 5px 0; } #mySidenav a:hover { left: 0; /* slides fully into view */ } ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference) - **μ‹ λ’° 점수:** 0.82 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[W3Schools HOW TO]] - **κ΄€λ ¨ κ°œλ…:** [[HOWTO CSS Fixed Sidebar]], [[HOWTO JS Sidenav]], [[HOWTO CSS Transition Hover]] - **μ°Έμ‘° λ§₯락:** CSS Buttons μ„Ήμ…˜μ˜ λ§ˆμ§€λ§‰ 챕터 β€” CSS Navigation & Menus μ„Ήμ…˜μœΌλ‘œ 이어짐. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” How To - Side Navigation Buttons β€” https://www.w3schools.com/howto/howto_css_sidenav_buttons.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "How To - Side Navigation Buttons" recipe (Astra wiki-curation, P-Reinforce v3.1 format).