@@ -248,31 +248,31 @@ Keyframes</h2>
248
248
so the first will be ignored:
249
249
250
250
<pre class=lang-css>
251
- @keyframes foo { ... }
252
- @keyframes "foo" { ... }
251
+ @keyframes foo { /* ... */ }
252
+ @keyframes "foo" { /* ... */ }
253
253
</pre>
254
254
255
255
On the other hand,
256
256
the following ''@keyframes'' rule's name is <em> different</em> from the previous two rules:
257
257
258
258
<pre class=lang-css>
259
- @keyframes FOO { ... }
259
+ @keyframes FOO { /* ... */ }
260
260
</pre>
261
261
262
262
The following ''@keyframes'' rules are invalid
263
263
because they use disallowed <<custom-ident>> values:
264
264
265
265
<pre class=lang-css>
266
- @keyframes initial { ... }
267
- @keyframes None { ... }
266
+ @keyframes initial { /* ... */ }
267
+ @keyframes None { /* ... */ }
268
268
</pre>
269
269
270
- However, those names * can* be specified with a <<string>> ,
270
+ However, those names <em> can</em> be specified with a <<string>> ,
271
271
so the following are both <em> valid</em> :
272
272
273
273
<pre class=lang-css>
274
- @keyframes "initial" { ... }
275
- @keyframes "None" { ... }
274
+ @keyframes "initial" { /* ... */ }
275
+ @keyframes "None" { /* ... */ }
276
276
</pre>
277
277
</div>
278
278
@@ -295,58 +295,62 @@ Keyframes</h2>
295
295
the last one in document order wins,
296
296
and all preceding ones are ignored.
297
297
298
- <div class='example'>
299
- <pre>
300
- div {
301
- animation-name: slide-right;
302
- animation-duration: 2s;
303
- }
298
+ <div class='example'>
299
+ <pre>
300
+ div {
301
+ animation-name: slide-right;
302
+ animation-duration: 2s;
303
+ }
304
304
305
- @keyframes slide-right {
305
+ @keyframes slide-right {
306
306
307
- from {
308
- margin-left: 0px;
309
- }
307
+ from {
308
+ margin-left: 0px;
309
+ }
310
310
311
- 50% {
312
- margin-left: 110px;
313
- opacity: 1;
314
- }
311
+ 50% {
312
+ margin-left: 110px;
313
+ opacity: 1;
314
+ }
315
315
316
- 50% {
317
- opacity: 0.9;
318
- }
316
+ 50% {
317
+ opacity: 0.9;
318
+ }
319
319
320
- to {
321
- margin-left: 200px;
322
- }
320
+ to {
321
+ margin-left: 200px;
322
+ }
323
323
324
- }
325
- </pre>
324
+ }
325
+ </pre>
326
326
327
- At the 1s mark, the slide-right animation will have the same state as if we had defined the 50% rule like this:
327
+ The two 50% rules from above can also be combined into an equivalent single rule
328
+ as illustrated below:
328
329
329
- <pre>
330
+ <pre>
330
331
331
- @keyframes slide-right {
332
+ @keyframes slide-right {
332
333
333
- 50% {
334
- margin-left: 110px;
335
- opacity: 0.9;
336
- }
334
+ from {
335
+ margin-left: 0px;
336
+ }
337
337
338
- to {
339
- margin-left: 200px;
340
- }
338
+ 50% {
339
+ margin-left: 110px;
340
+ opacity: 0.9;
341
+ }
341
342
342
- }
343
- </pre>
343
+ to {
344
+ margin-left: 200px;
345
+ }
344
346
345
- </div>
347
+ }
348
+ </pre>
349
+ </div>
346
350
347
351
To determine the set of keyframes, all of the values in the selectors are sorted in increasing order
348
- by time. The rules within the @keyframes rule then cascade; the properties of a keyframe may thus derive
349
- from more than one @keyframes rule with the same selector value.
352
+ by time. The rules within the '' @keyframes'' rule then cascade; the properties of a keyframe may thus derive
353
+ from more than one '' @keyframes'' rule with the same selector value.
350
354
351
355
If a property is not specified for a keyframe, or is specified but invalid, the animation of that
352
356
property proceeds as if that keyframe did not exist. Conceptually, it is as if a set of keyframes is
0 commit comments