--- id: howto-css-sticky-element title: "How To - Sticky Element" category: "Web_Recipes" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["position sticky CSS"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.84 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["howto", "css", "w3schools", "layout", "position", "sticky"] raw_sources: ["https://www.w3schools.com/howto/howto_css_sticky_element.asp"] applied_in: [] github_commit: "" --- # [[HOWTO CSS Sticky Element]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) `position: sticky` is a HYBRID of the two positioning models this cookbook has already covered separately β€” it behaves like `position: relative` (occupying its normal place in the document flow) until the scroll position reaches the specified offset (`top: 0`), at which point it switches to behave like `position: fixed` (pinned to the viewport) β€” meaning it's not a third independent positioning scheme but a scroll-triggered TOGGLE between the two schemes already used in `[[HOWTO CSS Fixed Menu]]` and ordinary flow layout. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`position: sticky`** β€” toggles between `relative` and `fixed` behavior depending on scroll position. [S1] - **Requires an offset property** β€” at least one of `top`, `right`, `bottom`, or `left` MUST be specified, or sticky positioning does nothing. [S1] - **Browser support caveat** β€” explicitly noted to NOT work in Internet Explorer or Edge 15 and earlier. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Minimal example: `div.sticky { position: sticky; top: 0; }`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) - **relative와 fixed 사이λ₯Ό μŠ€ν¬λ‘€μ— 따라 ν† κΈ€ν•˜λŠ” ν•˜μ΄λΈŒλ¦¬λ“œ**: `[[HOWTO CSS Fixed Menu]]`μ—μ„œ ν™•μΈλœ 순수 `position: fixed`와 달리, stickyλŠ” 슀크둀 μœ„μΉ˜κ°€ μ§€μ •λœ μ˜€ν”„μ…‹μ— λ„λ‹¬ν•˜κΈ° μ „μ—λŠ” 일반 흐름(relative)을 λ”°λ₯΄λ‹€κ°€ κ·Έ 지점뢀터 fixed처럼 κ³ μ •λœλ‹€λŠ” 점이 두 λ°©μ‹μ˜ κ²°ν•©μœΌλ‘œ 확인됨. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” top:0 μ˜€ν”„μ…‹μ„ μ§€μ •ν•œ μ΅œμ†Œ sticky μ˜ˆμ œκ°€ μ›λ¬Έμ—μ„œ μ œμ‹œλ¨. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Sticky positioning β€” toggles between relative and fixed on scroll (CSS): ```css div.sticky { position: sticky; top: 0; /* at least one offset is required */ } ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference) - **μ‹ λ’° 점수:** 0.84 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[W3Schools HOW TO]] - **κ΄€λ ¨ κ°œλ…:** [[HOWTO CSS Fixed Menu]], [[HOWTO CSS Sticky Social Bar]], [[HOWTO JS Navbar Sticky]] - **μ°Έμ‘° λ§₯락:** CSS Layout & Positioning μ„Ήμ…˜. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” How To - Sticky Element β€” https://www.w3schools.com/howto/howto_css_sticky_element.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "How To - Sticky Element" recipe (Astra wiki-curation, P-Reinforce v3.1 format).