{"id":14125,"date":"2011-09-06T18:57:44","date_gmt":"2011-09-07T01:57:44","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=14125"},"modified":"2022-09-30T12:20:02","modified_gmt":"2022-09-30T19:20:02","slug":"transition","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/t\/transition\/","title":{"rendered":"transition"},"content":{"rendered":"\n

The transition<\/code> property is a shorthand property used to represent up to four transition-related longhand properties:<\/p>\n\n\n\n

.element {\n  transition: background-color 0.5s ease;\n}<\/code><\/pre>\n\n\n

Syntax<\/h3>\n\n\n
transition: [transition-property] [transition-duration] [transition-timing-function] [transition-delay];<\/code><\/pre>\n\n\n

Demo<\/h3>\n\n\n

transition<\/code> properties allow elements to change values over a specified duration, animating the property changes, rather than having them occur immediately. So, if we have, say, a box with a red background that we want to change to a green background when it is hovered, we can reach right for the transition<\/code> property to move between background colors:<\/p>\n\n\n\n