I have applied a gradient as the background color for one element, but I also have a different background color for when the element is hovered over. Currently, when hovering over an element with the class .tinted
, it flashes because it first shows no background and then applies the color rgba(0,0,0,0.65)
.
Is there a way to make the transition go directly from the background:
gradient(left, rgba(0,0,0,0.65), rgba(0,0,0,0.30))
to rgba(0,0,0,0.65)
without the flash?
.tinted {
transition: background-color 500ms linear;
background: -webkit-linear-gradient(left, rgba(0,0,0,.65), rgba(0,0,0,.30));
background: -o-linear-gradient(right, rgba(0,0,0,.65), rgba(0,0,0,.30));
background: -moz-linear-gradient(right, rgba(0,0,0,.65), rgba(0,0,0,.30));
background: linear-gradient(to right, rgba(0,0,0,.65), rgba(0,0,0,.30));
}
.tinted:hover {
background: rgba(0, 0, 0, 0.65);
}