{"id":13714,"date":"2011-08-20T11:21:43","date_gmt":"2011-08-20T18:21:43","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=13714"},"modified":"2022-09-22T12:37:31","modified_gmt":"2022-09-22T19:37:31","slug":"animation","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/a\/animation\/","title":{"rendered":"animation"},"content":{"rendered":"\n

The animation<\/code> property in CSS can be used to animate many other CSS properties such as color<\/code><\/a>, background-color<\/code><\/a>, height<\/code><\/a>, or width<\/code><\/a>. Each animation needs to be defined with the @keyframes<\/code> at-rule<\/a> which is then called with the animation<\/code> property, like so:<\/p>\n\n\n\n

.element {\n  animation: pulse 5s infinite;\n}\n\n@keyframes pulse {\n  0% {\n    background-color: #001F3F;\n  }\n  100% {\n    background-color: #FF4136;\n  }\n}<\/code><\/pre>\n\n\n\n