<div class="animated-image"> <img src="images/scpiyao.jpg" alt="Your Image"> </div> @keyframes moveRightLeft { 0% { transform: translateX(0); } 50% { transform: translateX(500px); /* 你可以根据需要调整这个值 */ } 100% { transform: trans...
<div class="animated-image">
<img src="images/scpiyao.jpg" alt="Your Image">
</div>
@keyframes moveRightLeft {
0% {
transform: translateX(0);
}
50% {
transform: translateX(500px); /* 你可以根据需要调整这个值 */
}
100% {
transform: translateX(0);
}
}
/* 应用动画到图片 */
.animated-image img {
animation-name: moveRightLeft;
animation-duration: 5s; /* 动画持续时间 */
animation-iteration-count: infinite; /* 无限次循环 */
animation-timing-function: linear; /* 匀速 */
}