Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CSS滚动停止和重复问题_Css - Fatal编程技术网

CSS滚动停止和重复问题

CSS滚动停止和重复问题,css,Css,我无法使文本对齐或正确滚动,因为某些原因,它想在滚动中间停止,并跳到最后一个 欢迎光临 家 家族 朋友 欢迎光临 由于您的线高度是50px,因此关键帧动画应该基于50px的倍数,而不是40px @keyframes change { 0% { margin-top: 0; } 23% { margin-top: 0; } 33% { margin-top: -50px; } 46% { margin-top: -50px;

我无法使文本对齐或正确滚动,因为某些原因,它想在滚动中间停止,并跳到最后一个


  • 欢迎光临
  • 家族
  • 朋友
  • 欢迎光临

由于您的
线高度是50px,因此关键帧动画应该基于50px的倍数,而不是40px

@keyframes change {
  0% {
    margin-top: 0;
  }
  23% {
    margin-top: 0;
  }
  33% {
    margin-top: -50px;
  }
    46% {
    margin-top: -50px;
  }

  56% {
    margin-top: -50px;
  }
  66% {
    margin-top: -100px;
  }
  90% {
    margin-top: -100px;
  }
  100% {
    margin-top: -150px;
  } 
}

它仍然在最后一行跳转,字体在括号中向下推
@keyframes change {
  0% {
    margin-top: 0;
  }
  23% {
    margin-top: 0;
  }
  33% {
    margin-top: -50px;
  }
    46% {
    margin-top: -50px;
  }

  56% {
    margin-top: -50px;
  }
  66% {
    margin-top: -100px;
  }
  90% {
    margin-top: -100px;
  }
  100% {
    margin-top: -150px;
  } 
}