白白系 2021-10-13 22:44 采纳率: 50%
浏览 47
已结题

我只是个小白,只是感兴趣喜欢前端学习 我的问题就是我做的这个动画用了两个div,每个div装了一张图片,每次两边移动的时候只有右边to2图片被推着动,左边不会动 在线求解答

<head>
    <meta charset="utf-8">
    <title></title>
    <style>
        div.t01{
            position: relative
            right: -100px;
            width: 0px;
            height: 5px;
            background-color: yellow;
            animation-name: boo;
            animation-duration: 10s;
            animation-iteration-count: infinite;
            animation-fill-mode: forwards;
            /* animation: boo 4s steps(); */
        }
        img{
            width: 20px;
            height: 20px;
            
        }
        @keyframes boo{
            0%{}
            100%{
                width: 30%;
            }
        }
        div.t02 {
            
            position: absolute;
            top: 8px;
            right: 200px;
            bottom: 200px;
            width: 0px;
            height: 5px;
            background-color: yellow;
            animation-name: boo1;
            animation-duration: 10s;
            animation-iteration-count: infinite;
            animation-fill-mode: forwards;
            /* animation: boo 4s steps(); */
        }
        @keyframes boo1{
            0%{}
            100%{
                width: 30%;
            }
        }
        .box3{
            
        }
    </style>
</head>
<body>
    <div class="t01">
        <img src="imgHdan.jpg">
    </div>
    <div class="t02">
        <img src="imgHdan.jpg">
    </div>
  • 写回答

2条回答 默认 最新

  • 钢镚是个小屁精 2021-10-14 09:54
    关注
       div.t01里加个text-align: right;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 10月22日
  • 已采纳回答 10月14日
  • 创建了问题 10月13日

悬赏问题

  • ¥20 matlab计算中误差
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊