2-20 作业代码实现情况,请老师帮忙检查一下,谢谢

来源:2-20 编程练习

呜蜩的呀

2022-08-01 20:13:28

相关代码:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>2-4</title>
    <style type="text/css">
        /* 创建一个div,用css控制其大小、边框、字体、位置等。 */
        div {
            /* 大小 */
            width: 800px;
            height: 600px;
            line-height: 600px;
            text-align: center;
            margin: auto;
            /* 字体 */
            font-family: 'Microsoft Yahei';
            font-size: 60px;
            font-weight: bold;
            /* 位置 */
            position: absolute;
            top: -1000px;
            right: 0;
            left: 0;
            /* 边框 */
            border: 5px solid #000;
            border-radius: 50%;
            /* 动画名称 */
            animation-name: disp;
            /* 动画总时长 */
            animation-duration: 1s;
            /*此处写代码*/
            /* 调用动画  */
            animation: disp 1s linear 2s forwards ;
        }

        /* 动画效果:在网页加载之后2s左右从上方飞下来 */

        @keyframes disp {
            form {
                top: -1000px;
            }
            to {
                top: 50%;
                margin-top: -300px;

            }
        }
    </style>
</head>

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

</html>


写回答

2回答

好帮手慕慕子

2022-08-02

同学你好,代码实现是可以的,继续加油,祝学习愉快~

0

imooc_慕慕

2022-08-02

同学你好,整体思路是可以的,题目效果中不需要回弹,所以直接写一个top属性就可以了,修改参考如下图所示:

https://img.mukewang.com/climg/62e8808109e6dc8603860253.jpg

祝学习愉快~

0

0 学习 · 17877 问题

查看课程