--- 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 `