十一121 2022-03-08 09:42 采纳率: 100%
浏览 58
已结题

为什么我的西游四人组这个样子

#我的西游四人行

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

<head>
  <meta charset="UTF-8">
  <title>大话西游</title>
  <style>
    body{
      /*外边距*/
        margin: 0px;
        background-image: url("images/background.jpg")
    }
    .west{
      /*高度*/
      width:760px;
       /*宽度*/
      height:180px;
       /*上下左左右边距自动相等*/
       margin: 300px auto;
        /*颜色*/
    }
    .role{
      /*从左到右,横排显示*/
      float: left;
      width: 190px;
      height: 240px;
      background-repeat:no-repeat;
      background-position-y: center;
    }
    /*选择到第几个class标签叫做west的子元素*/
    .role:nth-child(1){
      background-image: url('images/wk.png');
      animation: wk 1.4s steps(8) infinite;
      
    }
    .role:nth-child(2){
      background-image: url('images/bj.png');
      animation: bj 1.4s steps(8) infinite;
    }
    .role:nth-child(3){
      background-image: url('images/ts.png');
      animation: ts 1.4s steps(8) infinite;

    }
    .role:nth-child(4){
      background-image: url('images/ss.png');
      animation: ss 1.4s steps(8) infinite;

    }
    @keyframes wk{
      0%{
        background-position-x: 0px;
      }
      100%{
        background-position-x: -1600px;
      }
    }

@keyframes bj{
      0%{
        background-position-x: 0px;
      }
      100%{
        background-position-x: -1600px;
      }
    }
    @keyframes ts{
      0%{
        background-position-x: 0px;
      }
      100%{
        background-position-x: -1360px;
      }
    }
    @keyframes ss{
      0%{
        background-position-x: 0px;
      }
      100%{
        background-position-x: -1680px;
      }
    }
  </style>
</head>

<body>

  <div class="west">
    <div class="role"></div>
    <div class="role"></div>
    <div class="role"></div>
    <div class="role"></div>
  </div>

</body>

</html>
```?

![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/970425307646192.png "#left")
  • 写回答

3条回答 默认 最新

  • 前端互助会 2022-03-08 10:07
    关注

    img


    很明显你的png图片不是透明的,还存在白色的底,需要去掉的

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 3月16日
  • 已采纳回答 3月8日
  • 创建了问题 3月8日

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog