Hover Gradient

I want to make the background of a link a gradient when it is hovered over but I can not figure it out? help

You can do it like this:

The Link/ Anchor (You should be able to use most html elements):

<a>This is my Link</a>

The CSS:

a {
    background-image: none;
}
a:hover {
    background-image: linear-gradient(red, yellow);
}

What this CSS does is firstly change the background-image to nothing when you’re not hovering over it.

The other part (a:hover) only happens when you hover over the link. This changes the background to red at the top that gradually goes to yellow at the bottom