--- id: css-transitions title: "CSS Transitions" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["transition", "CSS transition", "smooth transition", "hover transition", "transition shorthand"] 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", "transition", "animation"] raw_sources: ["https://www.w3schools.com/css/css3_transitions.asp"] applied_in: [] github_commit: "" --- # [[CSS Transitions]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) CSS transitions allow you to change property values smoothly, over a given duration, typically triggered by a state change such as `:hover`. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Purpose** β€” CSS transitions allow you to change property values smoothly, over a given duration. [S1] - **Shorthand** β€” the `transition` property is a shorthand for `transition-property`, `transition-duration`, `transition-timing-function`, and `transition-delay`. [S1] - **Trigger required** β€” a transition runs when the targeted property changes value (for example, on `:hover`). [S1] - **Per-property durations** β€” multiple properties can each be given their own duration in a single comma-separated `transition` declaration. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Property + duration** β€” at minimum specify which property to transition and how long it takes: `transition: width 2s;`. [S1] - **State-change activation** β€” define the base rule, then change the property in a `:hover` (or similar) rule to drive the transition. [S1] - **Comma-separated multi-property** β€” list several `property duration` pairs separated by commas to transition them concurrently with different timings. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **The CSS `transition` Property** CSS transitions allows you to change property values smoothly, over a given duration. [S1] **CSS Transition Example** The following example shows a 100px * 100px `
` element. The `
` element has specified a transition effect for the width property, with a duration of 2 seconds: [S1] ```css div { width: 100px; height: 100px; background-color: red; transition: width 2s; } ``` **How to Trigger the Transition** Now, we add a `div:hover` class that specifies a new value for the width property when a user mouses over the `
` element: [S1] ```css div:hover { width: 300px; } ``` **Change Multiple Property Values** The following example adds a transition effect for the width, height, and background-color properties, with a duration of 2 seconds for the width, 4 seconds for the height, and 3 seconds for the background-color: [S1] ```css div { transition: width 2s, height 4s, background-color 3s; } ``` **CSS Transition Properties** The following table lists the CSS transition properties: [S1] | Property | Description | |----------|-------------| | `transition` | A shorthand property for setting the four transition properties into a single property | | `transition-delay` | Specifies a delay (in seconds) for the transition effect | | `transition-duration` | Specifies how many seconds or milliseconds a transition effect takes to complete | | `transition-property` | Specifies the name of the CSS property the transition effect is for | | `transition-timing-function` | Specifies the speed curve of the transition effect | ## πŸ› οΈ 적용 사둀 (Applied in summary) The page applies a transition to a `
` whose width grows from 100px to 300px over 2 seconds on hover, and a multi-property example transitioning width, height, and background-color with distinct durations. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Single-property transition triggered on hover (language: CSS): ```css div { width: 100px; height: 100px; background-color: red; transition: width 2s; } div:hover { width: 300px; } ``` Multiple properties with different durations: ```css div { transition: width 2s, height 4s, background-color 3s; } ``` ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (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 Transition Timing]], [[CSS Animations]], [[CSS 3D Transforms]] - **μ°Έμ‘° λ§₯락:** The entry point for smoothly animating property changes between two states; deeper control lives in the transition timing/delay properties. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Transitions β€” https://www.w3schools.com/css/css3_transitions.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Transitions" page (Astra wiki-curation, P-Reinforce v3.1 format).