"CSS3" animation animation-keyframes keyframes

Source: Internet
Author: User

1 <!DOCTYPE HTML>2 <HTML>3 <Head>4     <MetaCharSet= "Utf-8">5     <title></title>6     <Linkrel= "stylesheet"type= "Text/css"href= "Style.css">7 </Head>8 <Body>9     <Div></Div>Ten </Body> One </HTML>
1 Div{2 width:300px;3 Height:200px;4 Background-color:Red;5 Animation-name:myanimation;6 animation-duration:3s;7 animation-timing-function:Ease;8 Animation-delay:1s;9 Animation-iteration-count:3/*Infinite*/;/*Infinite always play*/Ten animation-direction:Alternate;/*Normal*/;/*Specifies the sequence of playback for the next cycle of the animation, that is, the order of the odd number of plays: normal default order play, alternate reverse play*/ One Animation-fill-mode:both;/*By default None, the animation will stop in its original state. The forwards property value causes the animation to stop at the last frame state. Backwards will immediately switch to frame 1th and perform the Animation-delay delay. Both applies both the forwards and backwards property values. */ A Animation: ;/*all specific property values can be set in the shorthand property name, separated by a space between each property value*/ -} - @keyframes myanimation{ the /*from{ - width:150px; - height:100px; - Background-color:blue; +     } - to{ + width:200px; A height:150px; at Background-color:green; -     }*/ - 0%{ - Margin-left:20px; - Background-color:Pink; -} in 20%{ - Margin-left:100px; to Background-color:Orange; +} - 40%{ the Margin-top:100px; * Background-color:Yellow; $}Panax Notoginseng 60%{ - Margin-top:200px; the Background-image:Grey; +} A 100%{ the Margin-right:300px; + Margin-top:150px; - background:Green; $} $ }

"CSS3" animation animation-keyframes keyframes

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.