Home  >  Article  >  Web Front-end  >  Introduction to the implementation method of the animation effect of making pictures rotate in html5

Introduction to the implementation method of the animation effect of making pictures rotate in html5

黄舟
黄舟Original
2018-05-16 11:04:193987browse

1. Take a look at the effect first:

Introduction to the implementation method of the animation effect of making pictures rotate in html5

2. The code is like this:

The picture used by
<img src="images/circle.png" alt="" id="circle"/>
@mixin ani-btnRotate{
    @keyframes btnRotate{
        from{transform: rotateZ(0);}
        to{transform: rotateZ(360deg);}
    }
}
@include ani-btnRotate;
#circle{
    position: absolute;
    left: 50%;
    width: REM(338);
    height:  REM(338);
    margin-top: REM(200);
    margin-left: REM(-338/2);
    transform-origin: center center ;
    animation: btnRotate 1s 1s linear forwards;
    }

is this: (It is the white rotating picture)

Introduction to the implementation method of the animation effect of making pictures rotate in html5

The above is the detailed content of Introduction to the implementation method of the animation effect of making pictures rotate in html5. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn