Dino Geek, try to help you

How to reverse an animation in CSS?


To reverse an animation in CSS, you simply use the direction property within the animation property and set it to “reverse”. You can also set it to “alternate” to make the animation play in reverse on every other cycle.

Here’s an example:

```
@keyframes reverseAnimation { 0% { transform: rotate(0deg); }

100% { transform: rotate(360deg); } }

.myElement { animation: reverseAnimation 2s infinite reverse;
}
```

In this example, `myElement` will rotate 360 degrees counterclockwise. If you want it to rotate clockwise, then back to its original position, and repeat, set the animation direction to “alternate” instead of “reverse”.

```
.myElement { animation: reverseAnimation 2s infinite alternate;
}
```

The terms in the animation CSS shorthand stand for:

- `reverseAnimation`: the animation name.
- `2s`: the duration of the animation.
- `infinite`: the animation will loop indefinitely.
- `reverse` or `alternate`: the direction of the animation.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use