鼠标划过旋转180度并且切换图片

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .test {
            width: 103px;
            height: 103px;
            margin: 100px auto;
            position: relative;
        }
        img {
            width:103px;
            height:103px;
            position: absolute;
            transition: all 1s;
        }
        .test:hover img {
            transform: rotateY(180deg);
            background:#ccc;
            width:103px;
            height:103px;
            border-radius: 50%;
        }
        img.one {
            width:103px;
            height:103px;
            z-index: 9;
            backface-visibility: hidden;
        }
    </style>
</head>
<body>
<div class="test">
    <img class="one" src="./images/coreImg1.png" alt="">
    <img class="two" src="./images/coreImg1Hover.png" alt="">
</div>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/sunjynyue/article/details/82657885