📜  css 动画背景图片 - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:48.938000             🧑  作者: Mango

代码示例1
// use CSS3 @keyframes to animate the background-position
@keyframes animatedBackground {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 100% 0;
  }
}
#animate-area {
  width: 200px;
  height: 200px;
  background-image: url(http://placekitten.com/400/200);
  background-position: 0px 0px;
  background-repeat: repeat-x;
  animation: animatedBackground 10s linear infinite alternate;
}