运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <head> <style> #frameDiv { width: 400px; height: 180px; margin: 20px; position: relative; border: solid black 1px; background-color: rgb(205, 242, 205); } svg { position: absolute; height: 100%; width: 100%; left: 0; top: 0; } img { position: absolute; z-index: 1; width: 70px; offset-path: path('M 50 80 C 150 -20 250 180 350 80'); animation: moveFish 4s 4; } @keyframes moveFish { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } </style> </head> <body> <h1>The offset-distance property amnimated</h1> <div id="frameDiv"> <img id="fish1" src="img_fish.svg" alt="fish"> <svg fill="none" stroke="gray" stroke-width="2" stroke-dasharray="5,5"> <path d="M 50 80 C 150 -20 250 180 350 80" /> </svg> </div> </body> </html>