.ball { width: 100px; height: 100px; border-radius: 50%; background: red; position: relative; will-change: animation; animation: a 1s linear infinite alternate; } @keyframes a { 0% { left: 0; } 100% { left: 300px; } }