背景移動效果

  • 設定漸層背景
  • background-size高度放大
  • 設定CSS動畫,移動background-position
body
 width: 100vw
 height: 100vh
 background: linear-gradient(20deg, skyblue, SeaGreen 70%)
 background-size: 100% 300%
 animation: moving 8s infinite both
 
@keyframes moving
 0%
  background-position: 100% 30%
 100%
  background-position: 100% 100%