animation-fill-mode-003-manual.html (1648B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Animations Test: animation-fill-mode - backwards</title> 4 <link rel="author" title="Intel" href="http://www.intel.com"> 5 <link rel="reviewer" title="Zhiqiang Zhang" href="mailto:zhiqiang.zhang@intel.com"> <!-- 2015-05-07 --> 6 <link rel="help" href="https://drafts.csswg.org/css-animations-1/#animation-name"> 7 <link rel="help" href="https://drafts.csswg.org/css-animations-1/#animation-duration"> 8 <link rel="help" href="https://drafts.csswg.org/css-animations-1/#animation-delay"> 9 <link rel="help" href="https://drafts.csswg.org/css-animations-1/#animation-fill-mode"> 10 <meta name="flags" content="animated"> 11 <meta name="assert" content="When animation-fill-mode is set to backwards, 12 animation-delay is set a positive time offset, 13 and animation-direction is 'normal' or 'alternate-reverse', 14 animation will apply the from or 0% keyframe 15 that will start the first iteration."> 16 <style> 17 div { 18 animation-name: sample; 19 animation-duration: 5s; 20 animation-delay: 5s; 21 animation-fill-mode: backwards; 22 23 background-color: blue; 24 height: 100px; 25 width: 100px; 26 position: relative; 27 } 28 @keyframes sample { 29 from { 30 background-color: yellow; 31 } 32 to { 33 background-color: green; 34 } 35 } 36 </style> 37 <body> 38 <p> 39 Test passes if there is a filled color square with 'Filler Text', 40 whose color gradually changes in the order: YELLOW to GREEN. 41 After the animation is finished, the color goes back to BLUE. 42 </p> 43 <div>Filler Text</div> 44 </body>