过渡动画(html+css3)

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>过渡效果实战课3</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        .box {
            width: 200px;
            height: 200px;
            border: 1px solid #000;
            margin: 50px auto;
            /* 动画强度 */
            perspective: 500;
            position: relative;
            border-radius: 50%;
        }
        
        .box img {
            width: 200px;
            height: 200px;
            background-size: cover;
            border-radius: 50%;
        }
        
        .box img.dog {
            position: absolute;
            top: 0;
            left: 0;
            transform-origin: 0 0;
            transition: transform 3s ease 0s;
        }
        
        .box:hover img.dog {
            transform: rotateY(180deg);
        }
        
        .nov2 img.dog {
            transform-origin: 100% 100%;
        }
        
        .nov2:hover img.dog {
            transform: rotateY(-180deg);
        }
        
        .nov3 img.dog {
            transform-origin: 0 0;
        }
        
        .nov3:hover img.dog {
            transform: rotateX(180deg);
        }
    </style>
</head>

<body>
    <div class="box">
        <img src="https://img0.baidu.com/it/u=2773670528,4060665410&fm=253&fmt=auto&app=138&f=JPEG?w=890&h=500" alt="" class="dog">
        <img src="https://img0.baidu.com/it/u=4072492153,1313616486&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800" alt="" class="cat">
    </div>
    <div class="box  nov2">
        <img src="https://img0.baidu.com/it/u=2773670528,4060665410&fm=253&fmt=auto&app=138&f=JPEG?w=890&h=500" alt="" class="dog">
        <img src="https://img0.baidu.com/it/u=4072492153,1313616486&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800" alt="" class="cat">
    </div>
    <div class="box  nov3">
        <img src="https://img0.baidu.com/it/u=2773670528,4060665410&fm=253&fmt=auto&app=138&f=JPEG?w=890&h=500" alt="" class="dog">
        <img src="https://img0.baidu.com/it/u=4072492153,1313616486&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800" alt="" class="cat">
    </div>
</body>

</html>

效果图:

过渡动画(html+css3)

上一篇:理解FST


下一篇:Java基础----面向对象编程OOP之二