老师 帮忙看下哪里有问题 效果出来有点奇怪

来源:2-18 编程练习

lcy_18

2021-03-06 14:27:22

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>2-9</title>

    <style type="text/css">

     *{

     padding: 0;

     margin: 0;

     }

        div {

            font-family: Arial;

            font-size: 72px;

            font-weight: bold;

            position: fixed;

            right: 0;

            left: 0;

            width: 30px;

            height: 30px;

            margin: auto;

            transform: rotate(90deg);

            /*此处写代码*/

            position: absolute;

            left: 50%;

            margin-left: -15px;

            animation: arrow 1s ease 0s infinite;

        }

        

        @keyframes arrow{

         from{bottom: 40px;}

         to{bottom: 5px;}

        }

    </style>

</head>

<body>

    <div>&gt;</div>

</body>

</html>


写回答

1回答

好帮手慕星星

2021-03-06

同学你好,箭头有向左移动的效果。这是因为在垂直方向移动的时候超出了页面,垂直方向出现滚动了滚动条,导致页面内容减少,有向左移动的效果

http://img.mukewang.com/climg/60433340090cf53d19200193.jpg

建议改变下动画中bottom位置,参考

http://img.mukewang.com/climg/604333a509b248f403620244.jpg

祝学习愉快!

0

0 学习 · 15276 问题

查看课程