运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> #myImg { width: 200px; height: 400px; object-fit: cover; object-position: 0% 0%; animation: mymove 5s infinite; } @keyframes mymove { 0% { object-position: 0% 0%; } 25% { object-position: 20% 0%; } 100% { object-position: 100% 100%; } } </style> </head> <body> <h1>Animation of object-position</h1> <p>Gradually change the position of the image inside its content box:<p> <img src="paris.jpg" alt="Paris" id="myImg" width="400" height="300"> <p>Note: The object-position and object-fit properties are not supported in Edge 15 or earlier.</p> </body> </html>