1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> .back-to-top { background-image: url("https://cdn.jsdelivr.net/gh/cetr/cdn@master/blog/img/space-to-top.png"); width: 62px; height: 88px; }
.back-to-top:hover { animation: to-top-fly .4s steps(1) infinite; }
@keyframes to-top-fly { 0% { background-position-x: -142.5px; }
16.5% { background-position-x: -284.5px; }
33% { background-position-x: -429.5px; }
49.5% { background-position-x: -570.5px; }
66% { background-position-x: -714.5px; }
82.5% { background-position-x: -856.5px; }
100% { background-position-x: 0px; } } </style> </head> <body> <div class="back-to-top"></div> </body> </html>
|