CSS3 How to make pictures to achieve the effect of continuous rotation? Detailed

Source: Internet
Author: User
Tags html code example
This article will give you a detailed description of how to use CSS3 to make the picture to achieve a continuous rotation of the effect, we are in the page design, often encounter a variety of pictures of the problem, such as the need to let the picture fillet display, image Click to enlarge the display and so on effect.

In the previous article I also gave you a picture of the specific method of fillet display, you can also refer to this article "CSS How to control the image of arbitrary fillet style?" 】

The following is mainly to introduce the use of CSS3 to achieve automatic cycle 360 rotation of the specific method

The HTML code example is as follows:

<div class= "Demo" >    </div>"

The animated code example of a CSS picture rotated 360 degrees is as follows:

. demo{text-align:center;    margin-top:100px;} @-webkit-keyframes rotation{from    {-webkit-transform:rotate (0deg);}    to {-webkit-transform:rotate (360deg);}}. an{    -webkit-transform:rotate (360deg);    Animation:rotation 3s linear infinite;    -moz-animation:rotation 3s linear infinite;    -webkit-animation:rotation 3s linear infinite;    -o-animation:rotation 3s linear infinite;}. img{border-radius:250px;}

The above code can be directly copied and pasted locally for testing, then through the browser access, the effect is as follows:

Because the upload image is limited in size, GIF compression may cause the picture to not rotate. But normally, it rotates at the specified time, and we're going to notice the animation property, which is the shorthand attribute for all animated properties. We have added the transform and animation style attributes to the IMG image, which makes the picture 360-degree rotation animation effect.

CSS animated pictures automatically rotate the effect of the implementation method, as described above. Most animation effects can be achieved by mastering the transform and animation properties in CSS. Their principles are basically similar.

So the above is about how to use CSS3 to achieve automatic rotation of the picture 360-degree animation effect of the specific method. Have a certain reference value, hope to have the help of friends in need!

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.