--- id: css-position-static-and-relative title: "CSS Position Static and Relative" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["position property", "position static", "position relative", "CSS positioning", "document flow"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.89 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "position", "layout", "static", "relative"] raw_sources: ["https://www.w3schools.com/css/css_position.asp"] applied_in: [] github_commit: "" --- # [[CSS Position]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The `position` property controls element placement: `static` follows normal flow, while `relative` offsets an element from its normal position via `top`/`right`/`bottom`/`left`. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Positioning overrides flow** β€” CSS positioning is about controlling the placement of elements within a web page; you can override the normal document flow. [S1] - **`position` defines type** β€” the `position` property specifies the positioning type for an element. [S1] - **Offset properties** β€” elements are positioned to their final location with the `top`, `bottom`, `left`, and `right` properties. [S1] - **`static` is default** β€” all HTML elements are positioned static by default and are not affected by the `top`, `bottom`, `left`, and `right` properties. [S1] - **`relative` offsets from normal** β€” an element with `position: relative;` is positioned relative to its normal position in the document flow. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Static = leave it alone** β€” `position: static;` keeps an element in the normal flow, ignoring offset properties. [S1] - **Relative = nudge, keep the gap** β€” setting `top`/`right`/`bottom`/`left` on a relative element adjusts it away from its normal position, and other content is NOT adjusted to fill the gap left behind. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **CSS Positioning** CSS positioning is about controlling the placement of elements within a web page. With CSS positioning, you can override the normal document flow. [S1] **The CSS `position` Property** The `position` property specifies the positioning type for an element. Elements are then positioned to their final location with the `top`, `bottom`, `left`, and `right` properties. [S1] **Position values** [S1] | Value | Description | |-------|-------------| | `static` | This is default. Element is positioned according to the normal document flow | | `relative` | Element is positioned relative to its normal position in the document flow | | `fixed` | Element is positioned relative to the viewport | | `absolute` | Element is positioned relative to the nearest positioned ancestor | | `sticky` | Element toggles between a relative and fixed position, depending on the scroll position | **CSS `position: static`** All HTML elements are positioned static by default. Static positioned elements are not affected by the `top`, `bottom`, `left`, and `right` properties. An element with `position: static;` is always positioned according to the normal flow of the page: [S1] ```css div.static { position: static; border: 3px solid #73AD21; } ``` **CSS `position: relative`** An element with `position: relative;` is positioned relative to its normal position in the document flow. Setting the `top`, `right`, `bottom`, and `left` properties will cause the element to be adjusted away from its normal position. Other content will not be adjusted to fit into any gap left by the element: [S1] ```css div.relative { position: relative; left: 30px; border: 3px solid #73AD21; } ``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) - **`static`** β€” default; positioned according to the normal document flow and unaffected by offset properties. Choose when no special positioning is needed. [S1] - **`relative`** β€” positioned relative to its normal position; offsets move it but leave its original gap, and other content is not adjusted to fill it. Choose to nudge an element while preserving surrounding layout. [S1] - **`fixed`** β€” positioned relative to the viewport. [S1] - **`absolute`** β€” positioned relative to the nearest positioned ancestor. [S1] - **`sticky`** β€” toggles between relative and fixed depending on scroll position. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's own examples are the applied cases: a `div.static` left in normal flow and a `div.relative` offset by `left: 30px;`, both with a `#73AD21` border. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Static positioning (language: CSS): ```css div.static { position: static; border: 3px solid #73AD21; } ``` Relative positioning with offset (language: CSS): ```css div.relative { position: relative; left: 30px; border: 3px solid #73AD21; } ``` ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.89 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Display]], [[CSS Max Width]], [[CSS Visibility Hide]] - **μ°Έμ‘° λ§₯락:** Referenced whenever placing elements outside or relative to the normal document flow. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Position Static and Relative β€” https://www.w3schools.com/css/css_position.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Position Static and Relative" page (Astra wiki-curation, P-Reinforce v3.1 format).