--- 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: `