How can I apply a transition, for example in a background:linear-gradient(to top, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 40%)
without hover
and background:linear-gradient(to top, rgba(0,0,0,.8) 0%, rgba(0,0,0,0) 60%)
with hover
in the after of an element?
For example, I tried the following code:
a:after{
content:'';
top:0;
bottom:0;
left:0;
right:0;
position:absolute;
background:linear-gradient(to top, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 40%);
transition:background 1s ease-out
}
a:hover:after{
background:linear-gradient(to top,rgba(0,0,0,.8) 0%,rgba(0,0,0,0) 50%)
}
But apparently it did not work, is there any way to accomplish this?