原理
- 背景使用漸層色
- 放大背景寬度
- 使用動畫,移動background-position定位
範例
.box
.box
width: 200px
height: 150px
background: linear-gradient(20deg, #24260f, #90a955)
background-size: 100% 300%
animation: move 8s infinite both
@keyframes move
0%
background-position: 100% 30%
100%
background-position: 100% 100%
Display
.