How to understand the use of the Css3-webkit-animation-fill-mode property value as both

Source: Internet
Author: User

everyone knows that the-webkit-animation-fill-mode property is to retrieve or set the state outside the object's animation time, but I have always had a question about its property values, what is the difference between both and forwards? After constant testing and searching, the individual thinks the difference is:both isSets the state of an object to the end or start of an animation.mainly depends on the-webkit-animation-direction This attribute, why do you say so? Please see below:
<class= "center"></div>
1 . Center{2 Border:1px solid #332;3 width:60px;4 Height:60px;5 Border-radius:60px;6 background:Rgba (0,0,0,0.5);7 -webkit-animation:ani 1s ease-in 2 alternate both;8}9 @-webkit-keyframes ani{Ten 0%{-webkit-transform:TranslateX (0);} One 50%{-webkit-transform:TranslateX (40px);} A 100%{-webkit-transform:TranslateX (100px);} - }

Note: When the direction is set in the opposite direction, according to the number of times the animation performed to determine whether the ball is in the backwards or forwards state, the above code is to perform an even number of times, the animation back and forth movement, and finally back to the initial state of very backwards state, when the odd number of times, Is the end state forwards state

How to understand the use of the Css3-webkit-animation-fill-mode property value as both

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.