CSS3 of Animation (animation) properties (with code)

Source: Internet
Author: User
This article brings to you the content is about CSS3 animation (animation) attributes of the detailed (with code), there is a certain reference value, the need for friends can refer to, I hope to help you.

The CSS3 Animation (animation) has the following properties:

1. Animation-name Custom Animation name
2, animation-duration animation specifies how many seconds or milliseconds to complete, the default value is 0;
3, animation-timing-function animation of the time curve, linear uniform speed, ease first slow fast, before the end of slow.
4, the Animation-delay animation before the start of the delay interval, the default is 0
5. The number of times the Animation-iteration-count animation is played, the default is 1
6, animation-direction whether to rotate the reverse animation
7. Animation-play-state whether the animation is running or paused. Value: paused Specifies to pause the animation; running specifies the animation that is running, by default.

Example: This demo illustrates the whole process of animation with translation (translate) as an example

Html:

<body><div class= "Warp" ></div></body>

Css:

. warp{    height:100px;     width:100px;     border:1px solid #eee;            animation-name:moves;            Animation-direction:alternate;            animation-delay:0.2s;            animation-duration:5s;            animation-play-state:paused;            Animation-iteration-count:3;           /* Above can be written as: */           animation:moves 5s linear 0.2s 3;}

@keyframes moves{/* Animation name Custom */10%{/* Time point can be any, 10% means when the time to 10% is the element       The state to be reached */transform:translate (100px,0); -ms-transform:translate (100px,0); /*ie 9*/-moz-transform:translate (100px,0); /* Firefox */-webkit-transform:translate (100px,0); /* Safari and Chrome */-o-transform:translate (100px,0); /* Opera */}30%{/* Time point can be any */transform:translate (100px,100px);-ms-transform:translate (1 00px,100px); /*ie 9*/-moz-transform:translate (100px,100px); /* Firefox */-webkit-transform:translate (100px,100px); /* Safari and Chrome */-o-transform:translate (100px,100px); /* Opera */}60%{/* Time point can be any */transform:translate (0,100px);-ms-transform:translate (0, 100px); /*ie 9*/-moz-transform:translate (0,100px); /* Firefox */-webkit-transform:translate (0,100px); /* Safari and Chrome */-o-transform:translate (0,100px); /* Opera */}100%{/* points can be */transform:tran at any timeSlate (0,0);-ms-transform:translate (0,0); /*ie 9*/-moz-transform:translate (0,0); /* Firefox */-webkit-transform:translate (0,0); /* Safari and Chrome */-o-transform:translate (0,0); /* Opera */}}

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.