CSS Motion Background
Principle:
animation-name: bgmove;
animation-duration: 100s;animation-timing-function: linear;animation-delay: 0;animation-iteration-count: infinite;
Animation introduction:
Attribute |
Description |
Animation |
Specifies the stenographer value that defines all animation attributes except the animation-play-state. |
Animation-Delay |
Specifies the offset in the animation loop before the animation is displayed (the time amount starting from the loop ). This attribute value should use seconds as the unit (additional "S"-for exampleanimation-delay: 2s; ) |
Animation-direction |
Specifies the playback direction of an animation loop. Set animation-direction to "normal" "and the animation will be executed as expected (from attribute value 0% to 100% ). Set it to "reverse" "to achieve reverse effect. In multiple iteration settings, the value "alternating" and "reverse alternating" "will lead to the interchange between the" normal "" and "reverse" "modes of the animation. |
Animation-Duration |
Specifies the length of time for completing an animation loop. This attribute value should use seconds as the unit ("S" is appended to it, for exampleanimation-duration: 2s; ) |
Animation-fill-Mode |
Specifies whether the animation effect is visible before or after the animation starts to play. This attribute defines the CSS attribute applied to the element at the animation end. If you set this attribute to "NONE" (initial value), the animation element is returned to its original style attribute after the animation is completed. Set this attribute to "Forward" "to apply the final value of the animation at the end of the animation (the value specified in the" to "or" 100% "key frame ). |
Animation-iteration-count |
Defines the number of playback times of an animation loop. Set this property to "unlimited" "and the animation will be run indefinitely. |
Animation-name |
Specify one or more animation names. Specifies the animation name or CSS@ KeyframesAt-rule. |
Animation-play-state |
Specifies whether the animation is played or paused. With this attribute, you can pause the animation by setting this attribute value to "paused" ", and resume the animation by setting it to" running. Note that you will not restart the animation by resetting the animation-play-state of the ended animation to "running. To restart an animation, you must add it to the element again. |
Animation-timing-Function |
Specifies the intermediate attribute value to be used during a single loop of an animation. |
body{display: block; background: url('test.png') 5px 5px,url("test.png") 1050px 750px,url("test.png") 1000px -50px; -moz-animation-name: bgmove; -moz-animation-duration: 100s; -moz-animation-timing-function: linear; -moz-animation-delay: 0; -moz-animation-iteration-count: infinite; -webkit-animation-name: bgmove; -webkit-animation-duration: 100s; -webkit-animation-timing-function: linear; -webkit-animation-delay: 0; -webkit-animation-iteration-count: infinite; animation-name: bgmove; animation-duration: 100s; animation-timing-function: linear; animation-delay: 0; animation-iteration-count: infinite; }@-moz-keyframes bgmove{ 0%{ background:url('test.png') 5px 5px, url("test.png") 1050px 750px, url("test.png") 1000px -50px;}100%{ background:url('test.png') 2005px 1005px, url("test.png") 50px -250px, url("test.png") 0 950px;}}@-webkit-keyframes bgmove{ 0%{ background:url('test.png') 5px 5px, url("test.png") 1050px 750px, url("test.png") 1000px -50px;}100%{ background:url('test.png') 2005px 1005px, url("test.png") 50px -250px, url("test.png") 0 950px;}}