Hello I need to animate the changing of the background of a div, with the new background sliding down from above.
This is an example of what I can do now and the context of my question.
I need to trigger the animation by adding and removing classes:
.token {
width: 100px;
height: 100px;
border: 1px solid #000;
border-radius: 50%;
margin-bottom: 20px;
transition: background 1000ms linear;
}
.red {
background: red;
}
.blue {
background: blue;
}
As you can see I've already put a small animation, but I'm not sure if the slide down effect I need is possible with CSS alone.
What I would like is to be able to create multiple classes each changing the background of the div they're applied to via sliding down.
I need the animation to be triggered by adding a class, the class should contain the colour to transition to.