0
0
CSSmarkup~20 mins

Animation duration and delay in CSS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Animation Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
2:00remaining
What is the effect of this CSS animation code?
Consider the following CSS snippet:
@keyframes slide { from { left: 0; } to { left: 100px; } }
.box { position: relative; animation-name: slide; animation-duration: 2s; animation-delay: 1s; }

What happens when the page loads?
CSS
@keyframes slide { from { left: 0; } to { left: 100px; } }
.box { position: relative; animation-name: slide; animation-duration: 2s; animation-delay: 1s; }
AThe box moves from left 0 to 100px immediately and takes 2 seconds.
BThe box moves from left 0 to 100px over 1 second, then waits 2 seconds.
CThe box moves from left 0 to 100px over 3 seconds without delay.
DThe box waits 1 second, then moves from left 0 to 100px over 2 seconds.
Attempts:
2 left
💡 Hint
Think about what animation-delay does before the animation starts.
🧠 Conceptual
intermediate
2:00remaining
How does animation-delay affect multiple animations on the same element?
Given this CSS:
.circle { animation-name: grow, fade; animation-duration: 2s, 3s; animation-delay: 1s, 0s; }

Which statement is true?
CSS
.circle { animation-name: grow, fade; animation-duration: 2s, 3s; animation-delay: 1s, 0s; }
AThe 'grow' animation starts after 1 second delay; 'fade' starts immediately.
BBoth animations start immediately but have different durations.
CBoth animations start after 1 second delay.
D'fade' animation starts after 1 second delay; 'grow' starts immediately.
Attempts:
2 left
💡 Hint
Remember the order of values in animation-delay matches animation-name order.
rendering
advanced
2:00remaining
What will be the visible effect of this CSS animation timing?
Analyze this CSS:
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.light { animation: blink 4s infinite; animation-delay: 2s; }

What does the user see when the page loads?
CSS
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.light { animation: blink 4s infinite; animation-delay: 2s; }
AThe element is fully visible for 2 seconds, then starts blinking every 4 seconds.
BThe element blinks immediately every 4 seconds with no delay.
CThe element is invisible for 2 seconds, then blinks every 4 seconds.
DThe element blinks every 2 seconds with no initial delay.
Attempts:
2 left
💡 Hint
animation-delay delays the entire animation cycle start.
selector
advanced
2:00remaining
Which CSS selector applies animation-delay only to buttons inside a nav?
You want to apply a 1.5s animation delay only to buttons inside a
A.nav > button { animation-delay: 1.5s; }
Bbutton nav { animation-delay: 1.5s; }
Cnav button { animation-delay: 1.5s; }
Dbutton > nav { animation-delay: 1.5s; }
Attempts:
2 left
💡 Hint
Think about the order and relationship between elements in selectors.
accessibility
expert
2:00remaining
How should animation-delay be used to improve accessibility?
Which practice helps users sensitive to motion when using animation-delay in CSS?
AAvoid animation-delay and animations entirely for all users.
BRespect prefers-reduced-motion media query to disable or reduce animation-delay and animations.
CUse animation-delay only on background elements to keep focus on content.
DUse animation-delay with long delays to surprise users with sudden animations.
Attempts:
2 left
💡 Hint
Consider user preferences for reduced motion in settings.