Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is a keyframe animation in CSS?
A keyframe animation in CSS lets you change styles smoothly over time by defining specific points (keyframes) with different styles. The browser fills in the changes between these points.
Click to reveal answer
beginner
How do you define keyframes in CSS?
You use the @keyframes rule followed by a name and curly braces. Inside, you write percentages or keywords like from and to with style changes for each step.
Click to reveal answer
beginner
What does the animation-duration property do?
It sets how long the animation takes to complete one cycle, usually in seconds or milliseconds.
Click to reveal answer
intermediate
Explain the difference between from/to and percentage keyframes.
<code>from</code> is the same as 0% (start), and <code>to</code> is the same as 100% (end). Percentages let you add steps in between, like 50% for the middle of the animation.
Click to reveal answer
beginner
How can you make an animation repeat forever?
Use the animation-iteration-count property and set it to infinite.
Click to reveal answer
Which CSS rule is used to create keyframe animations?
A@frames
B@animation
C@keyframes
D@motion
✗ Incorrect
The correct rule to define keyframe animations is @keyframes.
What does animation-duration: 3s; mean?
AAnimation delays 3 seconds before starting
BAnimation starts after 3 seconds
CAnimation repeats 3 times
DAnimation runs for 3 seconds
✗ Incorrect
animation-duration sets how long one animation cycle lasts.
How do you specify the middle point of an animation?
AUse 50% in @keyframes
BUse from
CUse to
DUse 100%
✗ Incorrect
You use percentages like 50% to define intermediate steps in the animation.
Which property makes an animation repeat forever?
Aanimation-iteration-count: infinite;
Banimation-repeat: forever;
Canimation-loop: always;
Danimation-count: forever;
✗ Incorrect
The correct property is animation-iteration-count set to infinite.
What is the difference between from and to in keyframes?
AThey are not valid in keyframes
B<code>from</code> is 0%, <code>to</code> is 100%
CThey are the same and mean 50%
D<code>from</code> is 100%, <code>to</code> is 0%
✗ Incorrect
from means the start (0%) and to means the end (100%) of the animation.
Describe how to create a simple CSS animation that moves a box from left to right.
Think about defining start and end positions and telling the box to animate.
You got /3 concepts.
Explain how you can control the speed and repetition of a CSS animation.
Focus on properties that control time and loops.
You got /3 concepts.
Practice
(1/5)
1. What does the @keyframes rule do in CSS animations?
easy
A. Stops the animation immediately
B. Applies the animation to an HTML element
C. Sets the animation duration and delay
D. Defines the stages of an animation with style changes over time
Solution
Step 1: Understand the role of @keyframes
The @keyframes rule defines how styles change at different points during the animation timeline.
Step 2: Differentiate from animation properties
Properties like animation-duration or animation-name apply the animation, but @keyframes sets the actual style changes.
Final Answer:
Defines the stages of an animation with style changes over time -> Option D
A. Missing semicolon after width: 200px in keyframes
B. Incorrect animation property name; should be animation
C. Animation duration must be in milliseconds, not seconds
D. Missing @keyframes keyword
Solution
Step 1: Check syntax inside @keyframes
Each CSS declaration must end with a semicolon. The width: 200px line is missing a semicolon.
Step 2: Verify animation properties
The properties animation-name, animation-duration, and animation-iteration-count are correct and properly used.
Final Answer:
Missing semicolon after width: 200px in keyframes -> Option A
Quick Check:
CSS declarations need semicolons [OK]
Hint: Always end CSS declarations with semicolons [OK]
Common Mistakes:
Omitting semicolons inside keyframes
Confusing animation property names
Using wrong units for duration
5. You want to create a bouncing ball effect using keyframe animations. Which keyframe sequence best simulates a ball dropping and bouncing back up smoothly?