.element { background-color: red; transition: background-color linear .8s; } .element:hover { background-color: blue; }