Use CSS3 animation properties to achieve 360 & #176; infinite loop rotation [code snippets], css3

Source: Internet
Author: User

Use CSS3 animation properties to achieve 360 ° infinite loop rotation [code snippets], css3

Use the animation attribute of CSS3 to achieve 360 ° infinite loop rotation.

Code snippet:

<Div id = "test">

// custom image path

</Div>

CSS style Writing is as follows:

# Change {position: absolute; right: 200px;-webkit-animation: change 2 s linear infinite ;}

@-Webkit-keyframes change

{

0% {-webkit-transform: rotate (0deg );}

50% {-webkit-transform: rotate (180deg );}

100% {-webkit-transform: rotate (360deg );}

}

 

Done !!! Of course, only the chrome/Safari browser compatibility is provided here, and the following can be added:

@-Moz-keyframes change {***} Firefox

 

@-Ms-keyframes change {***} IE

@ Keyframes change {***} W3C

Operabrowser does not support the animation attribute !!!

 

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.