--- id: css-float title: "CSS Float" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["float", "CSS float", "float left", "float right", "wrap text around image", "floating elements"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.88 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "float", "layout"] raw_sources: ["https://www.w3schools.com/css/css_float.asp"] applied_in: [] github_commit: "" --- # [[CSS Float]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The `float` property places an element on the left or right side of its container, allowing text and inline elements to wrap around it β€” commonly used to wrap text around images. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **purpose** β€” the `float` property specifies how an element should float within its container, placing it on the left or right side so text and inline elements wrap around it. [S1] - **left** β€” the element floats to the left of its container. [S1] - **right** β€” the element floats to the right of its container. [S1] - **none (default)** β€” the element does not float and is displayed just where it occurs in the text. [S1] - **inherit** β€” the element inherits the float value of its parent. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Wrap text around an image** β€” apply `float: left` or `float: right` to an image so surrounding text flows around it. [S1] - **Side-by-side blocks** β€” float multiple block elements `left` (with padding) to lay them out next to each other in a row. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **Overview** [S1] The `float` property specifies how an element should float within its container. It places an element on the left or right side of its container, allowing text and inline elements to wrap around it. **Tip:** The `float` property is often used to wrap text around images! [S1] **Float values** [S1] - **left** β€” The element floats to the left of its container. - **right** β€” The element floats to the right of its container. - **none** β€” Default. The element does not float and is displayed just where it occurs in the text. - **inherit** β€” The element inherits the float value of its parent. **Float Right example** [S1] ```css img { float: right; } ``` **Float Left example** [S1] ```css img { float: left; } ``` **Float None example** [S1] ```css img { float: none; } ``` **Float Next to Each Other example** [S1] ```css div { float: left; padding: 15px; } .div1 { background: red; } .div2 { background: yellow; } .div3 { background: green; } ``` **Property reference** [S1] | Property | Description | |----------|-------------| | float | Specifies whether an element should float to the left, right, or not at all | ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's applied examples float an `img` right, left, and none, plus three `div`s floated left with padding and distinct background colors (red, yellow, green) laid out next to each other. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Float an image so text wraps around it (language: CSS): ```css img { float: right; } ``` Lay block elements out side by side (language: CSS): ```css div { float: left; padding: 15px; } .div1 { background: red; } .div2 { background: yellow; } .div3 { background: green; } ``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) - **left** β€” float to the container's left edge; content wraps on the right. [S1] - **right** β€” float to the container's right edge; content wraps on the left. [S1] - **none** β€” default; no floating, element stays in normal flow. [S1] - **inherit** β€” take the parent's float value. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.88 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Clear and Clearfix]], [[CSS Overflow]], [[CSS Position Fixed and Absolute]] - **μ°Έμ‘° λ§₯락:** Referenced whenever an element should sit to one side with content wrapping around it, or for side-by-side block layouts. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Float β€” https://www.w3schools.com/css/css_float.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Float" page (Astra wiki-curation, P-Reinforce v3.1 format).