forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.src.html
More file actions
1458 lines (1387 loc) · 51.8 KB
/
Overview.src.html
File metadata and controls
1458 lines (1387 loc) · 51.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN'
'http://www.w3.org/TR/html4/strict.dtd'>
<html lang="en">
<head>
<title>CSS Animations Module Level 3</title>
<link rel="stylesheet" type="text/css" href="default.css">
<style type="text/css">
.rhs { white-space: pre-wrap; }
code { font-size: inherit; }
#box-shadow-samples td { background: white; color: black; }
table {
border-collapse: collapse;
}
td {
padding: 0.2em 1em;
border: 1px solid black;
}
</style>
<link rel="stylesheet" type="text/css"
href="http://www.w3.org/StyleSheets/TR/W3C-WD.css">
</head>
<body>
<div class="head">
<!--logo-->
<h1>CSS Animations Module Level 3</h1>
<h2 class="no-num no-toc">[LONGSTATUS] [DATE]</h2>
<dl>
<dt>This version:
<dd><a href="[VERSION]">http://dev.w3.org/csswg/css3-animations/</a>
<!--http://www.w3.org/TR/[YEAR]/WD-[SHORTNAME]-[CDATE]-->
<dt>Latest version:
<dd><a
href="http://www.w3.org/TR/css3-animations">[LATEST]</a>
<dt>Previous version:
<dd><a href="http://www.w3.org/TR/2009/WD-css3-animations-20090320/">
http://www.w3.org/TR/2009/WD-css3-animations-20090320/</a>
<dt id="editors-list">Editors:
<dd><a href="mailto:dino@apple.com">Dean Jackson</a> (<a
href="http://www.apple.com/">Apple Inc</a>)
<dd><a href="mailto:hyatt@apple.com">David Hyatt</a> (<a
href="http://www.apple.com/">Apple Inc</a>)
<dd><a href="mailto:cmarrin@apple.com">Chris Marrin</a> (<a
href="http://www.apple.com/">Apple Inc</a>)
</dl>
<!--copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id="abstract">Abstract</h2>
<p>CSS Animations allow an author to modify CSS property values over
time.
<h2 class="no-num no-toc" id="status">Status of this document</h2>
<!--status-->
<h2 class="no-num no-toc" id="contents">Table of contents</h2>
<!--toc-->
<h2 id="introduction">Introduction</h2>
<p><em>This section is not normative.</em>
<p>
This document introduces new CSS features to enable animation.
</p>
<p>
Animation is currently possible in languages like SVG, but no system exists for the native animation of CSS styles. This proposal introduces <em>defined animations</em>, which specify the values that CSS properties will take over a given time interval.
</p>
<p>
This specification is an extension to CSS Transitions
[[!CSS3-TRANSITIONS]].
</p>
<h2>
Keyframes
</h2>
<p>
In a simple transition, since both the starting value and ending value
are known, a single timing function and duration determine the
intermediate values of the animating property. If finer control of the
intermediate values is required, keyframes can be used.
</p>
<p>
Keyframes are specified using a specialized CSS at-rule. A <span
class="prop-name">@keyframes</span> rule consists of the keyword
"@keyframes", followed by an identifier giving a name for the animation
(which will be referenced using <span
class="prop-name">'animation-name'</span>), followed by a set of style
rules (delimited by curly braces).
</p>
<p>
The <i>keyframe selector</i> for a keyframe style rule consists of a
comma-separated list of percentage values or the keywords 'from' or
'to'. The selector is used to specify the percentage along the duration
of the animation that the keyframe represents. The
keyframe itself is specified by the block of property values declared on
the selector. The keyword 'from' is equivalent to the value 0. The
keyword 'to' is equivalent to the value 100%. Note that the percentage
unit specifier must be used on percentage values. Therefore, "0" is an
invalid keyframe selector.
</p>
<p>
Keyframes can be specified in any order. The selector determines
the placement of the keyframe in the animation.
</p>
<p>
Every keyframe declaration must have a keyframe rule for
0% or 100%, possibly defined using "from" or "to". A keyframe
declaration without these keyframe selectors is invalid and will not
be available for animation.
</p>
<p>
The <i>keyframe declaration</i> for a keyframe rule consists of
properties and values. Properties that are unable to be
animated are ignored in these rules, with the exception of <span
class="prop-name">animation-timing-function'</span>, the behavior
of which is described below.
</p>
<p>
The @keyframes rule that is used by an animation will be the last one encountered in sorted rules order that matches the name of the animation. <span class="prop-name">@keyframes</span> rules do not cascade; therefore an animation will never derive keyframes from more than one <span class="prop-name">@keyframes</span> rule.
</p>
<p>
To determine the set of keyframes, all of the values in selectors are sorted in increasing order by time. If there are any duplicates, then the last keyframe specified inside the <span class="prop-name">@keyframes</span> rule will be used to provide the keyframe information for that time. There is no cascading within a <span class="prop-name">@keyframes</span> rule if multiple keyframes specify the same keyframe selector values.
</p>
<div class="example">
<p style="display:none">
Example(s):
</p>
<pre>
@keyframes 'wobble' {
0% {
left: 100px;
}
40% {
left: 150px;
}
60% {
left: 75px;
}
100% {
left: 100px;
}
}
</pre>Four keyframes are specified for the animation named "wobble". In the first keyframe, shown at the beginning of the animation cycle, the 'left' value of the animation is 100px. By 40% of the animation duration, 'left' value has animated to 150px. At 60% of the animation duration, the 'left' value has animated back to 75px. At the end of the animation cycle, the 'left' value has returned to 100px. The diagram below shows the state of the animation if it were given a duration of 10s.
<div class="figure">
<img src="animation1.png" alt="">
</div>
<p class="caption">
Animations states specified by keyframes
</p>
</div>
<p>
The following is the grammar for the keyframes rule.
</p>
<pre>
keyframes-rule: '@keyframes' IDENT '{' keyframes-blocks '}';
keyframes-blocks: [ keyframe-selectors block ]* ;
keyframe-selectors: [ 'from' | 'to' | PERCENTAGE ] [ ',' [ 'from' | 'to' | PERCENTAGE ] ]*;
</pre>
<!-- ======================================================================================================= -->
<h3>
Timing functions for keyframes
</h3>
<p>
A keyframe style rule may also declare the timing function that is to be used as the animation moves to the next keyframe.
</p>
<div class="example">
<p style="display:none">
Example(s):
</p>
<pre>
@keyframes 'bounce' {
from {
top: 100px;
animation-timing-function: ease-out;
}
25% {
top: 50px;
animation-timing-function: ease-in;
}
50% {
top: 100px;
animation-timing-function: ease-out;
}
75% {
top: 75px;
animation-timing-function: ease-in;
}
to {
top: 100px;
}
}
</pre>Five keyframes are specified for the animation named "bounce". Between the first and second keyframe (ie. between 0 and 25%) an "ease-out" timing function is used. Between the second and third keyframe (ie. between 25% and 50%) an "ease-in" timing function is used. And so on. The effect will appear as an element that moves up the page 50px, slowing down as it reaches its highest point then speeding up as it falls back to 100px. The second half of the animation behaves in a similar manner, but only moves the element 25px units up the page.
</div>
<p>
See <a href="#animation-timing-function_tag">the <span class="prop-name">'animation-timing-function'</span> property</a> for more information.
</p><!-- ======================================================================================================= -->
<h2>
Animations
</h2>
<p>
Animations are similar to transitions in that they change the presentational value of CSS properties over time. The principal difference is that while transitions trigger <i>implicitly</i> when property values change, animations are <i>explicitly</i> executed when the animation properties are applied. Because of this, animations require explicit values for the properties being animated. These values are specified using animation keyframes, described above.
</p>
<p>
Many aspects of the animation can be controlled, including how many times the animation iterates, whether or not it alternates between the begin and end values, and whether or not the animation should be running or paused. An animation can also delay its start time.
</p>
<div class="example">
<p style="display:none">
Example(s):
</p>
<pre>
div {
animation-name: 'diagonal-slide';
animation-duration: 5s;
animation-iteration-count: 10;
}
@keyframes 'diagonal-slide' {
from {
left: 0;
top: 0;
}
to {
left: 100px;
top: 100px;
}
}
</pre>This will produce an animation that moves an element from (0, 0) to (100px, 100px) over five seconds and repeats itself nine times (for a total of ten iterations).
</div>
<!-- ======================================================================================================= -->
<h3>
Animation behavior
</h3>
<p>
CSS Animations affect computed property values. During the execution of an animation, the
computed value for a property is controlled by the animation. This overrides the value
specified in the normal styling system.
</p>
<p>
In the case of multiple animations specifying behavior for the same property, the animation
defined last will override the previously defined animations.
</p>
<p>
An animation does not affect the computed value before the application of the animation,
before the animation delay has expired, and after the end of the animation.
</p>
<div class="figure">
<img src="sandwich.png" alt="">
</div>
<p class="caption">
Computation of animated property values
</p>
<p>
The diagram above shows how property values are computed. The intrinsic style is shown at the
top of the diagram. The computed value is derived from intrinsic style at the times when an
animation is not running and also when an animation is delayed (see below for specification of
animation delay). During an animation, the computed style is derived from the animated value.
</p>
<p>
The start time of an animation is the latter of two moments: the time at which the style is
resolved that specifies the animation, or the time the document's load event is fired.
Therefore, an animation specified in the document stylesheet will begin at the document load.
An animation specified on an element by modifying the style after the document has loaded will
start when the style is resolved. That may be immediately in the case of a pseudo style rule
such as hover, or may be when the scripting engine returns control to the browser (in the case
of style applied by script).
</p>
<p>
An animation applies to an element if the element has a value for
<span class="prop-name">'animation-name'</span> that references a valid
keyframes rule. Once an animation has started it continues until it ends
or the <span class="prop-name">'animation-name'</span> is removed. The values
used for the keyframes and animation properties are snapshotted at the
time the animation starts. Changing them during the execution of the
animation has no effect. Note also, that changing the value of
<span class="prop-name">'animation-name'</span> does not necessarily
restart an animation (e.g. if a list of animations are applied and
one is removed from the list, only that animation will stop; The other
animations will continue). In order to restart an animation, it must be
removed then reapplied.
</p>
<!-- ======================================================================================================= -->
<h3>
The <span class="prop-name">'animation-name'</span> Property
</h3>
<p>
The <span class="prop-name">'animation-name'</span> property defines a
list of animations that apply. Each name is used to select the keyframe at-rule
that provides the property values for the animation. If the name does
not match any keyframe at-rule, there are no properties to be animated
and the animation will not execute. Furthermore, if the animation name
is 'none' then there will be no animation. This can be used to override
any animations coming from the cascade.
</p>
<table class="propdef">
<tbody>
<tr>
<td>
<em>Name:</em>
</td>
<td>
<dfn id="animation-name">animation-name</dfn>
</td>
</tr>
<tr>
<td>
<em>Value:</em>
</td>
<td>
none | IDENT [, none | IDENT ]*
</td>
</tr>
<tr>
<td>
<em>Initial:</em>
</td>
<td>
none
</td>
</tr>
<tr>
<td>
<em>Applies to:</em>
</td>
<td>
block-level and inline-level elements
</td>
</tr>
<tr>
<td>
<em>Inherited:</em>
</td>
<td>
no
</td>
</tr>
<tr>
<td>
<em>Percentages:</em>
</td>
<td>
N/A
</td>
</tr>
<tr>
<td>
<em>Media:</em>
</td>
<td>
visual
</td>
</tr>
<tr>
<td>
<em>Computed value:</em>
</td>
<td>
Same as specified value.
</td>
</tr>
</tbody>
</table>
<!--
<p>
It is possible for elements to have multiple animations running that change the same property or properties. In this case the animations combine in a manner defined by the property. For example, animations on <span class="prop-name">opacity</span> will add together and animations on <span class="prop-name">transform</span> will have their transformation matrices multiplied.
</p>
<div class="example">
<p style="display:none">
Example(s):
</p>
<pre>
@keyframes 'border-bloat' {
from {
border-width: 0;
}
to {
border-width: 10px;
}
}
@keyframes 'border-diet' {
from {
border-width: 4px;
}
to {
border-width: 2px;
}
}
div {
animation-name: 'border-bloat', 'border-diet';
animation-duration: 10s, 4s;
}
</pre>
<p>
The above example has two animations executing on the same property, <span class="prop-name">border-width</span>. The animations are additive. That is, the
resulting value for the property will be the addition of the values from the
two animations.
</p>
<p>
At time '0s' the element's border will be 4px wide (0px from 'border-bloat' plus 4px from 'border-diet').
At time '4s' the element's border will be 6px wide (4px from 'border-bloat' plus 2px from 'border-diet').
At time '10s' the element's border will be 10px wide (10px from 'border-bloat' and no addition from
'border-diet' as it is no longer executing).
</p>
</div>
-->
<!-- ======================================================================================================= -->
<h3>
The <span class="prop-name">'animation-duration'</span> Property
</h3>
<p>
The <span class="prop-name">'animation-duration'</span> property defines the length of time that an animation takes to complete one cycle.
</p>
<table class="propdef">
<tbody>
<tr>
<td>
<em>Name:</em>
</td>
<td>
<dfn id="animation-duration">animation-duration</dfn>
</td>
</tr>
<tr>
<td>
<em>Value:</em>
</td>
<td>
<time> [, <time>]*
</td>
</tr>
<tr>
<td>
<em>Initial:</em>
</td>
<td>
0
</td>
</tr>
<tr>
<td>
<em>Applies to:</em>
</td>
<td>
block-level and inline-level elements
</td>
</tr>
<tr>
<td>
<em>Inherited:</em>
</td>
<td>
no
</td>
</tr>
<tr>
<td>
<em>Percentages:</em>
</td>
<td>
N/A
</td>
</tr>
<tr>
<td>
<em>Media:</em>
</td>
<td>
visual
</td>
</tr>
<tr>
<td>
<em>Computed value:</em>
</td>
<td>
Same as specified value.
</td>
</tr>
</tbody>
</table>
<p>
By default the value is '0', meaning that the animation cycle is immediate (i.e. there will be no animation). A negative value for <span class="prop-name">animation-duration</span> is treated as '0'.
</p>
<!-- ======================================================================================================= -->
<h3 id="animation-timing-function_tag">
The <span class="prop-name">'animation-timing-function'</span> Property
</h3>
<p>
The <span class="prop-name">'animation-timing-function'</span> property describes how the animation will progress over one cycle of its duration. See the <span class="prop-name">'transition-timing-function'</span> property [[!CSS3-TRANSITIONS]] for a complete description of timing function calculation.
</p>
<table class="propdef">
<tbody>
<tr>
<td>
<em>Name:</em>
</td>
<td>
<dfn id="animation-timing-function">animation-timing-function</dfn>
</td>
</tr>
<tr>
<td>
<em>Value:</em>
</td>
<td>
ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier(<number>, <number>, <number>, <number>) [, ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier(<number>, <number>, <number>, <number>)]*
</td>
</tr>
<tr>
<td>
<em>Initial:</em>
</td>
<td>
ease
</td>
</tr>
<tr>
<td>
<em>Applies to:</em>
</td>
<td>
block-level and inline-level elements
</td>
</tr>
<tr>
<td>
<em>Inherited:</em>
</td>
<td>
no
</td>
</tr>
<tr>
<td>
<em>Percentages:</em>
</td>
<td>
N/A
</td>
</tr>
<tr>
<td>
<em>Media:</em>
</td>
<td>
visual
</td>
</tr>
<tr>
<td>
<em>Computed value:</em>
</td>
<td>
Same as specified value.
</td>
</tr>
</tbody>
</table>
<p>
For a keyframed animation, the <span class="prop-name">'animation-timing-function'</span> applies
between keyframes, not over the entire animation. For example, in the case of an ease-in-out timing function, an animation will ease in at the start of the keyframe and ease out at the end of the keyframe. A <span class="prop-name">'animation-timing-function'</span> defined within a keyframe block applies to that keyframe, otherwise the timing function specified for the animation is used.
</p>
<!-- ======================================================================================================= -->
<h3>
The <span class="prop-name">'animation-iteration-count'</span> Property
</h3>
<p>
The <span class="prop-name">'animation-iteration-count'</span> property defines the number of times an animation cycle is played. The default value is one, meaning the animation will play from beginning to end once. A value of <span class="prop-value">'infinite'</span> will cause the animation to repeat forever. Non-integer numbers will cause the animation to end part-way through a cycle. Negative values for <span class="prop-name">'animation-iteration-count'</span> are treated as zero. This property is often used with an <span class="prop-name">'animation-direction'</span> value of <span class="prop-value">'alternate'</span>, which will cause the animation to play in reverse on alternate cycles.
</p>
<table class="propdef">
<tbody>
<tr>
<td>
<em>Name:</em>
</td>
<td>
<dfn id="animation-iteration-count">animation-iteration-count</dfn>
</td>
</tr>
<tr>
<td>
<em>Value:</em>
</td>
<td>
infinite | <number> [, infinite | <number>]*
</td>
</tr>
<tr>
<td>
<em>Initial:</em>
</td>
<td>
1
</td>
</tr>
<tr>
<td>
<em>Applies to:</em>
</td>
<td>
block-level and inline-level elements
</td>
</tr>
<tr>
<td>
<em>Inherited:</em>
</td>
<td>
no
</td>
</tr>
<tr>
<td>
<em>Percentages:</em>
</td>
<td>
N/A
</td>
</tr>
<tr>
<td>
<em>Media:</em>
</td>
<td>
visual
</td>
</tr>
<tr>
<td>
<em>Computed value:</em>
</td>
<td>
Same as specified value.
</td>
</tr>
</tbody>
</table><!-- ======================================================================================================= -->
<h3>
The <span class="prop-name">'animation-direction'</span> Property
</h3>
<p>
The <span class="prop-name">'animation-direction'</span> property defines whether or not the animation should play in reverse on alternate cycles. If <span class="prop-value">'alternate'</span> is specified, the animation cycle iterations that are odd counts are played in the normal direction, and the animation cycle iterations that are even counts are played in a reverse direction. When an animation is played in reverse the timing functions are also reversed. For example, when played in reverse an ease-in animation would appear to be an ease-out animation.
</p>
<table class="propdef">
<tbody>
<tr>
<td>
<em>Name:</em>
</td>
<td>
<dfn id="animation-direction">animation-direction</dfn>
</td>
</tr>
<tr>
<td>
<em>Value:</em>
</td>
<td>
normal | alternate [, normal | alternate]*
</td>
</tr>
<tr>
<td>
<em>Initial:</em>
</td>
<td>
normal
</td>
</tr>
<tr>
<td>
<em>Applies to:</em>
</td>
<td>
block-level and inline-level elements
</td>
</tr>
<tr>
<td>
<em>Inherited:</em>
</td>
<td>
no
</td>
</tr>
<tr>
<td>
<em>Percentages:</em>
</td>
<td>
N/A
</td>
</tr>
<tr>
<td>
<em>Media:</em>
</td>
<td>
visual
</td>
</tr>
<tr>
<td>
<em>Computed value:</em>
</td>
<td>
Same as specified value.
</td>
</tr>
</tbody>
</table><!-- ======================================================================================================= -->
<h3>
The <span class="prop-name">'animation-play-state'</span> Property
</h3>
<div class="issue">
We are considering removing 'animation-play-state' since its behaviour can
be replicated using other techniques. For example, by querying the
computed style, removing the animation and then setting style.
</div>
<p>
The <span class="prop-name">'animation-play-state'</span> property defines whether the animation is running or paused. A running animation can be paused by setting this property to <span class="prop-value">'paused'</span>. To continue running a paused animation this property can be set to <span class="prop-value">'running'</span>. A paused animation will continue to display the current value of the animation in a static state, as if the time of the animation is constant. When a paused animation is resumed, it restarts from the current value, not necessarily from the beginning of the animation.
</p>
<table class="propdef">
<tbody>
<tr>
<td>
<em>Name:</em>
</td>
<td>
<dfn id="animation-play-state">animation-play-state</dfn>
</td>
</tr>
<tr>
<td>
<em>Value:</em>
</td>
<td>
running | paused [, running | paused]*
</td>
</tr>
<tr>
<td>
<em>Initial:</em>
</td>
<td>
running
</td>
</tr>
<tr>
<td>
<em>Applies to:</em>
</td>
<td>
block-level and inline-level elements
</td>
</tr>
<tr>
<td>
<em>Inherited:</em>
</td>
<td>
no
</td>
</tr>
<tr>
<td>
<em>Percentages:</em>
</td>
<td>
N/A
</td>
</tr>
<tr>
<td>
<em>Media:</em>
</td>
<td>
visual
</td>
</tr>
<tr>
<td>
<em>Computed value:</em>
</td>
<td>
Same as specified value.
</td>
</tr>
</tbody>
</table><!-- ======================================================================================================= -->
<h3>
The <span class="prop-name">'animation-delay'</span> Property
</h3>
<p>
The <span class="prop-name">'animation-delay'</span> property defines when the animation will start. It allows an animation to begin execution some time after it is applied. An <span class="prop-name">'animation-delay'</span> value of '0' means the animation will execute as soon as it is applied. Otherwise, the value specifies an offset from the moment the animation is applied, and the animation will delay execution by that offset.
</p>
<p>
If the value for <span class="prop-name">'animation-delay'</span> is a negative time offset then the animation will execute the moment it is applied, but will appear to have begun execution at the specified offset. That is, the animation will appear to begin part-way through its play cycle. In the case where an animation has implied starting values and a negative <span class="prop-name">'animation-delay'</span>, the starting values are taken from the moment the animation is applied.
</p>
<table class="propdef">
<tbody>
<tr>
<td>
<em>Name:</em>
</td>
<td>
<dfn id="animation-trigger">animation-delay</dfn>
</td>
</tr>
<tr>
<td>
<em>Value:</em>
</td>
<td>
<time> [, <time>]*
</td>
</tr>
<tr>
<td>
<em>Initial:</em>
</td>
<td>
0
</td>
</tr>
<tr>
<td>
<em>Applies to:</em>
</td>
<td>
block-level and inline-level elements
</td>
</tr>
<tr>
<td>
<em>Inherited:</em>
</td>
<td>
no
</td>
</tr>
<tr>
<td>
<em>Percentages:</em>
</td>
<td>
N/A
</td>
</tr>
<tr>
<td>
<em>Media:</em>
</td>
<td>
visual
</td>
</tr>
<tr>
<td>
<em>Computed value:</em>
</td>
<td>
Same as specified value.
</td>
</tr>
</tbody>
</table><!-- ======================================================================================================= -->
<h3>
The <span class="prop-name">'animation'</span> Shorthand Property
</h3>
<p>
The <span class="prop-name">'animation'</span> shorthand property combines six of the animation properties into a single property.
</p>
<table class="propdef">
<tbody>
<tr>
<td>
<em>Name:</em>
</td>
<td>
<dfn id="animation">animation</dfn>
</td>
</tr>
<tr>
<td>
<em>Value:</em>
</td>
<td>
[<animation-name> ||
<animation-duration> ||
<animation-timing-function> ||
<animation-delay> ||
<animation-iteration-count> ||
<animation-direction>]
[, [<animation-name> ||
<animation-duration> ||
<animation-timing-function> ||
<animation-delay> ||
<animation-iteration-count> ||
<animation-direction>] ]*
</td>
</tr>
<tr>
<td>
<em>Initial:</em>
</td>
<td>
see individual properties
</td>
</tr>
<tr>
<td>
<em>Applies to:</em>
</td>
<td>
block-level and inline-level elements
</td>
</tr>
<tr>
<td>
<em>Inherited:</em>
</td>
<td>
no
</td>
</tr>
<tr>
<td>
<em>Percentages:</em>
</td>
<td>
N/A
</td>
</tr>
<tr>
<td>
<em>Media:</em>
</td>
<td>
visual
</td>
</tr>
<tr>
<td>
<em>Computed value:</em>
</td>
<td>
Same as specified value.
</td>
</tr>