Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How to solve level 14 lesson 9

to make the change-forever class element, take the style of the last keyframe of the animation.
by

1 Answer

sam5epi0l
Here is a possible solution:

<!DOCTYPE html>
<html>
<head>
<title>CSS animation fill mode</title>
<style>
.box {
background-color:#FFB643;
width: 150px;
height: 150px;
color: #4535AA;
margin: 100px;
}

.change-forever {
animation-name: trendy;
animation-duration: 2s;
animation-fill-mode:forwards;

}

.reset {
animation-name: trendy;
animation-duration: 2s;
}

@keyframes trendy {
0% { background-color: #4535AA; color: #ED639E; }
25% { background-color: #ED639E; color: #4535AA; }
50% { background-color: #FFB643; color: #4535AA; }
100% { background-color: #4535AA; color: #ED639E; }
}
</style>
</head>
<body>
<div class="box change-forever">Hello</div>
<div class="box reset">Studytonight!</div>
</body>
</html>

Login / Signup to Answer the Question.