" + html; } html = html.replace("",""); html = html.replace("",""); html = html.replace("",""); html = html.trim(); doc.innerHTML = html; return ( doc.innerHTML.toLowerCase() === html.toLowerCase() ); } function codeCheckWarningClose() { document.getElementById("codeCheckWarning").style.display = "none"; } function codeCheckCorrectClose() { document.getElementById("codeCheckCorrect").style.display = "none"; }
Menu
×
×
Correct!
Exercise:Specify that the animation of the <div> element should alternate between running forwards and backwards.
<style>
div {
width: 100px;
height: 100px;
position: relative;
background-color: red;
animation-name: example;
animation-duration: 4s;
animation-iteration-count: infinite;
@(19): @(9);
}
@keyframes example {
0% {background-color: red; left:0px; top:0px;}
25% {background-color: blue; left:0px; top:200px;}
50% {background-color: green; left:200px; top:200px;}
75% {background-color: yellow; left:200px; top:0px;}
100% {background-color: red; left:0px; top:0px;}
}
</style>
<body>
<div>This is a div</div>
</body>
<style>
div {
width: 100px;
height: 100px;
position: relative;
background-color: red;
animation-name: example;
animation-duration: 4s;
animation-iteration-count: infinite;
animation-direction: alternate;
}
@keyframes example {
0% {background-color: red; left:0px; top:0px;}
25% {background-color: blue; left:0px; top:200px;}
50% {background-color: green; left:200px; top:200px;}
75% {background-color: yellow; left:200px; top:0px;}
100% {background-color: red; left:0px; top:0px;}
}
</style>
<body>
<div>This is a div</div>
</body>
Not CorrectClick here to try again. Correct!Next ❯ |
This will reset the score of ALL 138 exercises.
Are you sure you want to continue?