CSS background-position प्रॉपर्टी को एनिमेट करने के लिए @keyframes का उपयोग करें, जिससे बैकग्राउंड इमेज चलती हुई दिखाई देती है।
उदाहरण
<!DOCTYPE html> <html> <head> <style> div { width: 500px; height: 400px; background: yellow; background-image: url('https://www.tutorialspoint.com/latest/microservice_architecture.png'); animation: myanim 3s infinite; background-position: bottom left; } @keyframes myanim { 20% { background-color: maroon; background-position: bottom right; } } </style> </head> <body> <div></div> </body> </html>
व्याख्या: बैकग्राउंड इमेज प्रारंभ में नीचे-बाएं है। 20% पर यह नीचे-दाएं चली जाती है, साथ ही बैकग्राउंड रंग मैरून हो जाता है।