--- id: css-2d-transforms title: "CSS 2D Transforms" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["transform", "CSS 2D transforms", "translate", "rotate", "scale skew matrix"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.86 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "transforms", "transform", "2d-transforms"] raw_sources: ["https://www.w3schools.com/css/css3_2dtransforms.asp"] applied_in: [] github_commit: "" --- # [[CSS 2D Transforms]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The CSS `transform` property applies 2D (or 3D) transformations to an element β€” letting you rotate, scale, move, and skew it β€” through methods such as `translate()`, `rotate()`, `scale()`, `skew()`, and `matrix()`. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`transform` applies a transformation** β€” the `transform` property applies a 2D or 3D transformation to an element, allowing you to rotate, scale, move, and skew it. [S1] - **2D transform methods** β€” CSS supports `translate()`, `rotate()`, `scaleX()`, `scaleY()`, `scale()`, `skewX()`, `skewY()`, `skew()`, and `matrix()`. [S1] - **`translate()` moves** β€” the `translate()` method moves an element from its current position according to the X-axis and Y-axis parameters given. [S1] - **`rotate()` rotates** β€” the `rotate()` method rotates an element clockwise or counter-clockwise by a given degree; negative values rotate counter-clockwise. [S1] - **`matrix()` combines methods** β€” `matrix()` defines a 2D transformation using a matrix of six values, combining all the 2D transform methods. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Move pattern** β€” `transform: translate(x, y);`. [S1] - **Rotate pattern** β€” `transform: rotate();` (negative degree = counter-clockwise). [S1] - **Method-vocabulary pattern** β€” single-axis variants (`translateX/Y`, `scaleX/Y`, `skewX/Y`) and combined forms (`scale`, `skew`, `matrix`) cover the full 2D transform set. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **Introduction** [S1] The CSS `transform` property applies a 2D or 3D transformation to an element. This property allows you to rotate, scale, move, and skew elements. **Available 2D transform methods** [S1] `translate()`, `rotate()`, `scaleX()`, `scaleY()`, `scale()`, `skewX()`, `skewY()`, `skew()`, `matrix()`. **The `translate()` Method** [S1] The `translate()` method moves an element from its current position (according to the parameters given for the X-axis and the Y-axis). The following example moves the element 50px to the right and 100px down: ```css div { transform: translate(50px, 100px); } ``` **The `rotate()` Method** [S1] The `rotate()` method rotates an element clockwise or counter-clockwise according to a given degree. Rotate the element 20 degrees clockwise: ```css div { transform: rotate(20deg); } ``` Using negative values will rotate the element counter-clockwise: ```css div { transform: rotate(-20deg); } ``` **The `scale()`, `skew()`, and `matrix()` Methods** The W3Schools 2D Transforms page lists these methods and describes them in its reference table (below), but their dedicated worked code examples live on separate follow-up pages and are not present on this page. Code examples for `scale`, `skew`, and `matrix` on this page: Not found in source. **CSS Transform Properties table** [S1] | Property | Description | |---|---| | `transform` | Applies a 2D or 3D transformation to an element | | `transform-origin` | Allows you to change the position on transformed elements | **2D Transform Methods/Functions table** [S1] | Function | Description | |---|---| | `matrix()` | Defines a 2D transformation, using a matrix of six values | | `translate()` | Defines a 2D translation, moving the element along the X- and the Y-axis | | `translateX()` | Defines a 2D translation, moving the element along the X-axis | | `translateY()` | Defines a 2D translation, moving the element along the Y-axis | | `scale()` | Defines a 2D scale transformation, scaling the element's width and height | | `scaleX()` | Defines a 2D scale transformation, scaling the element's width | | `scaleY()` | Defines a 2D scale transformation, scaling the element's height | | `rotate()` | Defines a 2D rotation, the angle is specified in the parameter | | `skew()` | Defines a 2D skew transformation along the X- and the Y-axis | | `skewX()` | Defines a 2D skew transformation along the X-axis | | `skewY()` | Defines a 2D skew transformation along the Y-axis | ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's own demonstrations (a `div` moved with `translate()` and rotated with `rotate()`, including the negative-degree counter-clockwise case) serve as the applied examples. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Move an element (language: CSS): ```css div { transform: translate(50px, 100px); } ``` Rotate clockwise / counter-clockwise: ```css div { transform: rotate(20deg); } ``` ```css div { transform: rotate(-20deg); } ``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) - **Single-axis vs combined methods** β€” use `translateX`/`translateY`, `scaleX`/`scaleY`, `skewX`/`skewY` to act on one axis, or the combined `translate`/`scale`/`skew` forms to act on both. [S1] - **Individual methods vs `matrix()`** β€” the readable methods (`translate`, `rotate`, `scale`, `skew`) cover common cases; `matrix()` packs all 2D transformations into a single six-value matrix. [S1] - **Positive vs negative `rotate()`** β€” positive degrees rotate clockwise, negative degrees counter-clockwise. [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.86 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) - **μ°Έκ³ :** Worked code for `scale`/`skew`/`matrix` was not on this page (lives on follow-up pages); recorded as "Not found in source" rather than invented. ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Box Shadow]], [[CSS Text Effects]], [[CSS Linear Gradients]] - **μ°Έμ‘° λ§₯락:** Referenced when visually moving, rotating, scaling, or skewing elements (hover effects, layout tweaks, animations). ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS 2D Transforms β€” https://www.w3schools.com/css/css3_2dtransforms.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS 2D Transforms" page (Astra wiki-curation, P-Reinforce v3.1 format).