--- id: css-animation-timing title: "CSS Animation Timing" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["animation-delay", "animation-iteration-count", "animation-timing-function", "infinite animation", "negative delay", "animation speed curve"] 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", "animation", "timing-function", "iteration"] raw_sources: ["https://www.w3schools.com/css/css3_animations_timing.asp"] applied_in: [] github_commit: "" --- # [[CSS Animation Timing]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) Animation timing controls when and how often an animation runs: `animation-delay` postpones (and, when negative, fast-forwards) the start, `animation-iteration-count` sets how many times it repeats (including `infinite`), and `animation-timing-function` sets the speed curve. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`animation-delay`** β€” specifies a delay for the start of an animation; negative values make the animation start as if it had already been playing for that many seconds. [S1] - **`animation-iteration-count`** β€” specifies the number of times an animation should run; accepts a number or the keyword `infinite`. [S1] - **`animation-timing-function`** β€” specifies the speed curve of the animation. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Negative delay = head start** β€” a negative `animation-delay` begins partway through the animation. [S1] - **Loop forever** β€” `animation-iteration-count: infinite;` repeats the animation endlessly. [S1] - **Speed-curve selection** β€” same value set as transitions: `ease` (default), `linear`, `ease-in`, `ease-out`, `ease-in-out`, `cubic-bezier(n,n,n,n)`. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **Delay an Animation** The `animation-delay` property specifies a delay for the start of an animation. The following example has a 2 seconds delay before starting the animation: [S1] ```css div { width: 100px; height: 100px; position: relative; background-color: red; animation-name: myAnimation; animation-duration: 4s; animation-delay: 2s; } ``` Negative values are also allowed. If using negative values, the animation will start as if it had already been playing for N seconds. In the following example, the animation will start as if it had already been playing for 2 seconds: [S1] ```css div { width: 100px; height: 100px; position: relative; background-color: red; animation-name: myAnimation; animation-duration: 4s; animation-delay: -2s; } ``` **Set How Many Times an Animation Should Run** The `animation-iteration-count` property specifies the number of times an animation should run. The following example will run the animation 3 times before it stops: [S1] ```css div { animation-iteration-count: 3; } ``` The following example uses the value "infinite" to make the animation continue for ever: [S1] ```css div { animation-iteration-count: infinite; } ``` **Specify the Speed Curve of the Animation** The `animation-timing-function` property specifies the speed curve of the animation. The `animation-timing-function` property can have the following values: [S1] - `ease` β€” specifies an animation with a slow start, then fast, then end slowly (this is default). [S1] - `linear` β€” specifies an animation with the same speed from start to end. [S1] - `ease-in` β€” specifies an animation with a slow start. [S1] - `ease-out` β€” specifies an animation with a slow end. [S1] - `ease-in-out` β€” specifies an animation with a slow start and end. [S1] - `cubic-bezier(n,n,n,n)` β€” lets you define your own values in a cubic-bezier function. [S1] The following example shows the different speed curves that can be used: [S1] ```css #div1 {animation-timing-function: linear;} #div2 {animation-timing-function: ease;} #div3 {animation-timing-function: ease-in;} #div4 {animation-timing-function: ease-out;} #div5 {animation-timing-function: ease-in-out;} ``` ## πŸ› οΈ 적용 사둀 (Applied in summary) The page applies a 2-second positive delay and a -2-second negative delay to a `
`, runs an animation 3 times and then infinitely via `animation-iteration-count`, and demonstrates the five named speed curves across `#div1`–`#div5`. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Delay and iteration count (language: CSS): ```css div { animation-name: myAnimation; animation-duration: 4s; animation-delay: 2s; animation-iteration-count: infinite; } ``` Speed curve: ```css #div1 {animation-timing-function: linear;} #div2 {animation-timing-function: ease;} ``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) The `animation-timing-function` values offer the same trade-offs as in transitions: `linear` holds a constant speed; `ease` (default) accelerates then decelerates; `ease-in`/`ease-out` slow only the start or end; `ease-in-out` slows both ends; and `cubic-bezier(n,n,n,n)` defines a custom curve. For `animation-iteration-count`, choose a finite number for a bounded effect or `infinite` for continuous loops (e.g. spinners). [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 Animations]], [[CSS Animation Properties]], [[CSS Transition Timing]] - **μ°Έμ‘° λ§₯락:** Adds delay, repeat, and speed-curve control on top of the basic `@keyframes` animation. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Animation Timing β€” https://www.w3schools.com/css/css3_animations_timing.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Animation Timing" page (Astra wiki-curation, P-Reinforce v3.1 format).