CSS3 animation (CSS3 Frame animation)

Source: Internet
Author: User

Email: gm4linus@gmail.com

In the past, DOM animation in the browser was implemented through js. CSS 3 now provides the animation function, I .e., animation. The following is an example of a progress bar to illustrate how to use it.

 

First, create a small HTML clip.

 

  

 

 

Next, write CSS.

 

. Animation {/* defines CSS3 animation */-webkit-animation-name: animation-name;/* specifies the animation name, which is used with keyiframes */-webkit-animation-duration: 10 s;/* animation duration */-webkit-animation-timing-function: linear;/* animation playback mode, the current value is linear */-webkit-animation-iteration-count: infinite;/* Number of animation playback times. The current value is an infinite loop */-webkit-animation-delay: 2 s; /* animation delay start time */-webkit-animation-direction: 'normal';/* playback direction * // *-webkit-animation-play-state: 'running '; playback status */animation-name: animation-name; animation-duration: 10 s; animation-timing-function: linear; animation-iteration-count: infinite ;} @-webkit-keyframes animation-name {/* CSS3 Frame animation timeline, compatible with webkit private attributes */0% {width: 0 ;}100% {width: 100% ;}} @ keyframes animation-name {/* CSS3 Frame animation timeline */0% {width: 0;} 100% {width: 100% ;}}. wp. inner {/* CSS2 */display: inline-block; width: 0; height: 20px; border-radius: 4px; background-color: # 5bc0de ;}

In this way, the inner and animation class can be applied.

N/index.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.