老师,我这个心动的动画为什么动不起来

来源:2-21 自由编程

weixin_慕沐1378591

2020-10-29 18:23:03

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <style>

        .out{

            width88px;

            height81px;

            positionrelative;

            /* background-image: url(./images/xin.png); */

            margin100px auto;

        }

        .out .in{

            width88px;

            height81px;

            positionabsolute;

            background-imageurl(./images/xin.png);

            /* animation: xidong 1s linear 0s; */

        }

        .out .in img{

            border1px solid #000;

            transformscale(1);

            animation: xidong 1s linear 0s infinite;

        }


        @keyframes xindong{

            from{

                transformscale(1);

                opacity1;

            }

            to{

                transformscale(5);

                opacity0;

            }

        }

    </style>

</head>

<body>

    <div class="out">

        <div class="in">

            <img src="./images/xin.png" alt="">

        </div>

    </div>

</body>

</html>


写回答

1回答

好帮手慕星星

2020-10-29

同学你好,是定义的帧动画名称和使用名字不一致的原因,参考修改

http://img.mukewang.com/climg/5f9aa4400911423d05740279.jpg

代码中也去掉了多余的border边框,看着更美观一些。

祝学习愉快!

1
heixin_慕沐1378591
h 额,发现了...
h020-11-01
共1条回复

0 学习 · 15276 问题

查看课程