--- id: w3css-sidebar title: "W3CSS Sidebar" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["w3-sidebar", "w3-overlay", "side navigation", "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", "sidebar", "navigation"] raw_sources: ["https://www.w3schools.com/w3css/w3css_sidebar.asp"] applied_in: [] github_commit: "" --- # [[W3CSS Sidebar]] ## ๐ŸŽฏ ํ•œ ์ค„ ํ†ต์ฐฐ (One-line insight) "Open over content" and "slide content to the right" are NOT the same interaction despite looking similar โ€” the former only toggles the sidebar's own `display`, while the latter additionally animates the MAIN content's `margin-left`, meaning a push-style sidebar requires coordinating two separate elements' styles in the same JS function, not just revealing the sidebar itself. [S1] ## ๐Ÿง  ํ•ต์‹ฌ ๊ฐœ๋… (Core concepts) - **`w3-sidebar`** โ€” the base class for a vertical, typically fixed-position side navigation panel. [S1] - **Six distinct sidebar interaction patterns** โ€” always-visible, collapsible-responsive, overlay-over-part, overlay-over-all, slide-content-right, and right-side instead of left. [S1] - **`margin-left` reservation** โ€” an always-visible sidebar requires the adjacent content div to have a matching `margin-left` (e.g. sidebar `width:25%` pairs with content `margin-left:25%`) so content doesn't render underneath it. [S1] - **`w3-collapse`** โ€” combined with `w3-hide-large`, creates a sidebar that's always visible on large screens but hidden/toggle-controlled on small screens. [S1] - **`w3-overlay`** โ€” adds a semi-transparent (50% opacity) black layer over page content while the sidebar is open, visually emphasizing the open sidebar without changing its position. [S1] - **Right-side placement** โ€” simply swapping `style="left:0"` for `style="right:0"` (or omitting `left` and adding `right:0`) relocates the entire sidebar system to the opposite edge. [S1] ## ๐Ÿ“– ์„ธ๋ถ€ ๋‚ด์šฉ (Details) - Always-visible sidebar with reserved content margin: `
...
... page content ...
`. [S1] - Slide-content-right (distinct from simple overlay): `function w3_open() { document.getElementById("main").style.marginLeft = "25%"; document.getElementById("mySidebar").style.width = "25%"; document.getElementById("mySidebar").style.display = "block"; }` โ€” moves BOTH the sidebar and the main content. [S1] - Overlay effect: `
` shown/hidden alongside the sidebar via the same open/close functions. [S1] - Collapsible responsive sidebar: `
...
` paired with a `w3-main` content div using matching `margin-left`. [S1] ## โš–๏ธ ๋ชจ์ˆœ ๋ฐ ์—…๋ฐ์ดํŠธ (Contradictions & updates) - **์˜ค๋ฒ„๋ ˆ์ด vs ์ฝ˜ํ…์ธ  ๋ฐ€๊ธฐ์˜ ์ฐจ์ด**: ๋‹จ์ˆœ ์˜ค๋ฒ„๋ ˆ์ด๋Š” ์‚ฌ์ด๋“œ๋ฐ”์˜ display๋งŒ ๋ฐ”๊พธ์ง€๋งŒ, "์Šฌ๋ผ์ด๋“œ" ๋ฐฉ์‹์€ ์‚ฌ์ด๋“œ๋ฐ”๋ฟ ์•„๋‹ˆ๋ผ ๋ฉ”์ธ ์ฝ˜ํ…์ธ ์˜ marginLeft๊นŒ์ง€ ํ•จ๊ป˜ ๋ณ€๊ฒฝํ•ด์•ผ ํ•œ๋‹ค๋Š” ๊ตฌํ˜„ ์ฐจ์ด๊ฐ€ ์žˆ์Œ. [S1] ## ๐Ÿ› ๏ธ ์ ์šฉ ์‚ฌ๋ก€ (Applied in summary) ํ˜„์žฌ ๋ฐœ๊ฒฌ๋œ ์‹ค์ œ ์ ์šฉ ์‚ฌ๋ก€๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค โ€” w3-overlay๋กœ ์‚ฌ์ด๋“œ๋ฐ” ์˜คํ”ˆ ์‹œ ๋ฐฐ๊ฒฝ์„ ์–ด๋‘ก๊ฒŒ ์ฒ˜๋ฆฌํ•ด ์‹œ์„ ์„ ์ง‘์ค‘์‹œํ‚ค๋Š” ํŒจํ„ด์ด ๋ชจ๋ฐ”์ผ ๋ฉ”๋‰ด UX์˜ ๋Œ€ํ‘œ ์‹ค์ „ ๊ธฐ๋ฒ•์ด๋‹ค. [S1] ## ๐Ÿ’ป ์ฝ”๋“œ ํŒจํ„ด (Code patterns) Sidebar with a semi-transparent overlay over the page content (HTML/JS): ```html
``` ## โœ… ๊ฒ€์ฆ ์ƒํƒœ ๋ฐ ์‹ ๋ขฐ๋„ - **์ƒํƒœ:** draft - **๊ฒ€์ฆ ๋‹จ๊ณ„:** conceptual - **์ถœ์ฒ˜ ์‹ ๋ขฐ๋„:** B (W3Schools โ€” widely used educational reference, not a primary standards body) - **์‹ ๋ขฐ ์ ์ˆ˜:** 0.87 - **์ค‘๋ณต ๊ฒ€์‚ฌ ๊ฒฐ๊ณผ:** ์‹ ๊ทœ ์ƒ์„ฑ (New discovery) ## ๐Ÿ”— ์ง€์‹ ๊ทธ๋ž˜ํ”„ (Knowledge Graph) - **์ƒ์œ„/๋ฃจํŠธ:** [[W3.CSS Tutorial]] - **๊ด€๋ จ ๊ฐœ๋…:** [[W3CSS Navigation]], [[W3CSS Accordions]], [[W3CSS Dropdowns]], [[W3CSS Tabulators]] - **์ฐธ์กฐ ๋งฅ๋ฝ:** Navigation Components ์„น์…˜ ๋งˆ์ง€๋ง‰ โ€” UI Components ์„น์…˜์˜ ํƒญ(Tabulators) ์ฑ•ํ„ฐ๋กœ ์ด์–ด์ง. ## ๐Ÿ“š ์ถœ์ฒ˜ (Sources) - [S1] W3Schools โ€” W3.CSS Sidebar โ€” https://www.w3schools.com/w3css/w3css_sidebar.asp ## ๐Ÿ“ ๋ณ€๊ฒฝ ์ด๋ ฅ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "W3.CSS Sidebar" page (Astra wiki-curation, P-Reinforce v3.1 format).