码迷,mamicode.com
首页 > Web开发 > 详细

CSS3 animation属性 实现转动效果

时间:2019-09-24 08:19:55      阅读:1000      评论:0      收藏:0      [点我收藏+]

标签:lan   src   style   body   inf   form   anim   scale   pat   


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta charset="utf-8">
    <title>旋转效果</title>
    <style>


        div {
            width:100%;
            margin:50px auto;
            text-align: center;

        }

        img {
            width: 200px;
            height: 200px;
            border-radius: 100px;
            animation: run 5s linear infinite;
            -webkit-animation: run 5s linear infinite;
            animation-play-state: running;
            -webkit-animation-play-state: running;
        }

        img:hover {
            animation-play-state: paused;
            -webkit-animation-play-state: paused;
        }

        @keyframes run {
            0% {
                transform: rotate(0deg);
            }

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

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

            100% {
                transform: rotate(360deg);
            }
        }
    </style>
</head>

<body>
    <div>
        <img src="bg.png" />
    </div>
</body>

</html>
 

 

CSS3 animation属性 实现转动效果

标签:lan   src   style   body   inf   form   anim   scale   pat   

原文地址:https://www.cnblogs.com/lwming/p/11576041.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!