Home >Web Front-end >CSS Tutorial >Set shorthand properties for all animated properties using CSS
The shorthand property for setting all animation properties is animation. It sets the animation duration, animation name, etc.
You can try running the following code to use the animated shorthand attribute:
Live Demo
<!DOCTYPE html> <html> <head> <style> div { width: 150px; height: 200px; background-color: yellow; animation: myanim 2s } @keyframes myanim { from { background-color: green; } to { background-color: blue; } } </style> </head> <body> <div></div> </body> </html>
The above is the detailed content of Set shorthand properties for all animated properties using CSS. For more information, please follow other related articles on the PHP Chinese website!