请老师帮忙检查一下代码,谢谢

来源:2-20 编程练习

廖可爱bongbong

2021-05-15 10:10:48

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>2-4</title>

    <style type="text/css">

        div {

            font-family: 'Microsoft Yahei';

            font-size: 60px;

            font-weight: bold;

            line-height: 600px;

            position: absolute;

            top: -1000px;

            right: 0;

            left: 0;

            width: 800px;

            height: 600px;

            margin: auto;

            text-align: center;

            border: 5px solid #000;

            border-radius: 50%;

            animation-name: disp;

            animation:fr 1s ease 2s forwards;

        }

            /*此处写代码*/

            @keyframes fr{

                from{

                    top:-1000px;

                }

                to{

                    top:0;

                }

            }

            

   </style>

</head>

<body>

    <div>大家好,欢迎来到慕课网!</div>

</body>

</html>


写回答

1回答

好帮手慕然然

2021-05-15

同学你好,代码实现效果是可以的,不过任务中规定动画持续时间为2s,且延迟时间设置的是1s。同学使用animate属性设置动画时,将动画持续时间和延迟时间写反了,animate属性的正确语法格式为:animation: 动画名称  持续时间   速度曲线   延迟时间   播放次数   播放方向。

建议参考以下修改:

http://img.mukewang.com/climg/609f3bf509950a9e04670105.jpg

祝学习愉快!

0

0 学习 · 15276 问题

查看课程