css过渡效果-仿镜子翻盖

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title></title>
    <style type="text/css">
        .box1 {
            height: 200px;
            width: 200px;
            margin: 200px auto;
            perspective: 500px;
        }

        img {
            width: 200px;
            height: 200px;
            border: 1px solid #000;
            border-radius: 50%;
        }

        .dog {
            position: absolute;
            top: 0;
            left: 0;
            transform-origin: 0 0;
            transition: transform 1s ease 0s;
        }

        .box1:hover img.dog {
            transform: rotateY(-180deg);
        }
    </style>
</head>

<body>
    <div class="box1">
        <img src="images/a.jpg" alt="" class="cat">
        <img src="images/b.jpg" alt="" class="dog">
    </div>
</body>

</html>

猜你喜欢

转载自blog.csdn.net/weixin_46324536/article/details/128961419