A gradient transition can be performed with a bit of "cheating". I'm definitely not a professional in css stuff (and I'm new here, so I don't hate me quickly: D), but just put them in divs on top of each other, with opacity 1 and a second from 0. (Each div sets different gradients). When hovering, change the opacity from 1 to 0 and vice versa.
Set the synchronization function, and yet, these divs fit on top of each other, the z-index property does the rest. (Optimized for Safari) Maybe a beginner, but it works (surprisingly) perfectly:
#divgradient1 { z-index:-1; height:100px; background: -webkit-linear-gradient(90deg, red, blue); background: -o-linear-gradient(90deg, red, blue); background: -moz-linear-gradient(90deg, red, blue); background: linear-gradient(90deg, red, blue); opacity:1; transition:background,opacity,z-index; -webkit-transition:background,opacity,z-index ; transition-duration: 1s; -webkit-transition-duration: 1s; } #divgradient1:hover{ z-index:-1; opacity:0; transition:background,opacity,z-index; -webkit-transition:background,opacity,z-index; transition-duration: 1s; -webkit-transition-duration: 1s; } #divgradient2:hover{ opacity:1; z-index:2; background: -webkit-linear-gradient(-90deg, red, blue); background: linear-gradient(-90deg, red, blue); transition:background,opacity,z-index; -webkit-transition:background,opacity,z-index; transition-duration: 1s; -webkit-transition-duration: 1s; } #divgradient2 { z-index:1; opacity:0; height:100px; background: -webkit-linear-gradient(-90deg, red, blue); background: linear-gradient(-90deg, red, blue); transition:background,opacity,z-index; -webkit-transition:background,opacity,z-index; transition-duration: 1s; -webkit-transition-duration: 1s; }
and no matter what it should look like: div /
<div id="divgradient1" style="position:absolute;width:100px;"></div> <div id="divgradient2" style="position:absolute;width:100px;"></div>