老师好,请检查2-12作业,谢谢

来源:2-12 编程练习

慕桂英1122475

2023-03-06 16:40:58

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 200px;
            height: 200px;
            margin: 40px auto;
            perspective: 500px;
            position: relative;
        }

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

        .box img.dog {
            position: absolute;
            top: 0;
            left: 0;
            /* 这个属性必须添加在hover之前,否则会导致取消过渡的时候,从中间翻滚 */
            transform-origin: 100% 100%;
            transition: transform 1s ease 0s;
       
        }

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

<body>
    <div class="box">
        <img class="cat" src="http://climg.mukewang.com/5f87bfa208ca046706500650.jpg" alt="">
        <img class="dog" src="http://climg.mukewang.com/5f87c06b088e3a1000000000.jpg" alt="">
   </div>
   </body>
   </html>


写回答

1回答

imooc_慕慕

2023-03-06

同学你好,代码效果实现正确,很棒,祝学习愉快~

0

0 学习 · 17877 问题

查看课程