I am not able to apply the transition property on hover for changing the gradient. I have attached the code for reference. I am not sure, where I am going wrong.
#grad1 {
height: 150px;
width: 500px;
background-color: red;
transition: background-color 2s;
}
#grad1:hover {
background-image: linear-gradient(to right, red, yellow);
}
<div id="grad1"></div>