. rotation { -webkit-animation-name:rotation; -webkit-animation-duration:30s; -moz-animation-name:rotation; -moz-animation-duration:30s; } #sun { Background:url ("Http://img.mukewang.com/55ade004000106c202010201.png") no-repeat; Position:absolute; z-index:1; Top: -30px; height:201px; width:201px; right:40%;} @-webkit-keyframes Rotation { 0% { transform:translatex (0) translatey (0); } 100% { Transform:translatex ( -2000px) Translatey (400px);} /*? */ } @-moz-keyframes Rotation {/ *? */ 0% { transform:translatex (0) translatey (0);} 100% { Transform:translatex ( -2000px) Translatey (400px);} }
Animation-name: The setting of the animation frame is set by the keyword keyframes
Duration set the time for the animation to complete
In this example there is a div ID sum showing the effect of a sunset
CSS3 using animation for animation effects