CSS Transition shorthand


Example

CSS

div{
    width: 150px;
    height:150px;
    background-color: red;
    transition: background-color 1s;
}
div:hover{
    background-color: green;
}

HTML

<div></div>

This example will change the background color when the div is hovered the background-color change will last 1 second.