How to animate image circular in css

2019-09-20 08:40发布

I want to rotate the image and animate accordingly, can someone help me out, below is the link for the gif image

https://drive.google.com/file/d/0B92S5c2PO_OIeUZJU0g2dnY3S3c/view?usp=sharing

标签: css3
1条回答
Anthone
2楼-- · 2019-09-20 09:09

Here is a solution

http://jsfiddle.net/aquadk/m23sadrz/

CSS

.image {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    margin:-60px 0 0 -60px;
    -webkit-animation:spin 4s linear infinite;
    -moz-animation:spin 4s linear infinite;
    animation:spin 4s linear infinite;
}
@-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } }
@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }

HTML

<img class="image" src="http://makeameme.org/media/templates/120/grumpy_cat.jpg" alt="" width="120" height="120">
查看更多
登录 后发表回答